The most common causes of javascipt errors are:
The upgrade script did not run correctly when upgrading the gallery.
If you have just updated the gallery, please install the gallery one more time to make sure the upgrade script runs.
Jquery has not been included on the page.
Jquery has not been included twice the page.
Using the Jquery Easy Plugin.
Sometimes many extensions include jquery on the page, and it can be difficult to adjust the extensions so there is just one jquery library at the top of the page. Jquery Easy is a Joomla extension that will remove all jquery links and place one at the top of the page. Please use the settings shown below: