Adds sorting of the gallery files due to different orders on different devices
Fixes invert