fix gallery loading