Hello. You got me completely interested in your project. It looks like a challenge.
But I need to better assess it as I don't want to promise to do something for a quote and then realize it's a harder problem that will require more effort.
Could you explain me with samples what are the "actions" that should be done which come in the images file names?
Also, you describe your problem as a Javascript problem, however you only have "PHP" in the skill set of the problem, that lead me to think:
a. you didn't care about that and "PHP" got there by default
b. it's a Javascript + PHP problem, then the fix will come from checking both front and back end code.
c. you have a site running under Node.js, then this is only a Javascript problem
Please tell me the exact scenario and if you can, edit your job post and add the "Javascript" skill to it, it's important for me.
Another good way to assess this would be to take a look at your current working script and that you tell me the approximate number of images this script should deal with. In particular I'd like to know which brick wall did you hit when trying your script on the big images folder.
Thanks for your attention so far and I hope you consider my offer seriously and can provide me further information.