Updated sorting of images in gallery-view