fix gallery nav problem