fixing <4 images in gallery js