fix gallery issue