You're getting the list of files, but they are in the order returned by the file system.
images = [img for img in os.listdir(image_folder) if img.endswith(".png")]
If your filenames are "image 1.png", "image 2.png", ... You're going to have to add a counting loop to your code to build the exact filename you need to deal with, in the order specified by your loop. You have done for...next loops with an index value, right?