Could you post the code, which shows how the images are saved?
Also, which order do you expect to see and which one is currently used while saving?
Since you are using an ImageFolder, did you check in which order the folder names are loaded?