Gallery page bug fixes