fixed javascript errors on gallery pages