Rotator and gallery script fix