fix gallery for different devices