Make images in gallery ordered

In 5.0 the images are not ordered, but chaotic.
They were ordered sometimes in 4.5
Merge pull request #754 from gunnicom/patch-1

Make images in gallery ordered