Your problem descriptions sound strange to me: Why would you run the same script 100 times on every file? At least that would be the result if you had 100 script invocations run on the same files, randomized or not. Or is there some code that ensures that an already processed file isn't done again? Or is the script run with different parameters?
Do the scripts transform the images, i.e. rewrite these files? Otherwise file locking would be unnecessary. But I can't imagine 100 transformations on a single image without having to do that in a specific order.