fix the gallery animation