What happens if you want to have more than one image per product? Have you tried your software with the supplied folder/file to see if maybe it works OK in that software "as is"?
Your problem is to create a list of folder names in a certain order, then rename files, in the proper order, with those folder names. You may also need to strip off characters other than the SKU number from folder names before making list to rename the files.
It's been a while since I've done batch files, but I do remember in DOS and probably also in Windows still, one could send a list of folder or file names to a text file to list them.
dir /ad >c:\names.txt
the list of folders in order would be in that text file, in the root directory.
Here's more use of the dir command which can help create a list of the files without the folders.
https://ss64.com/nt/dir.html
Ask around, you may find someone who can write a "script" or batch file to accomplish what you want for not too much moola. Just be sure to move a copy of all folders and files into a safe area to test the script, so you don't mess up the originals.