gallery changes (php -> javascript)