cleaned up how photo galleries work