fixed gallery script