Since I wanted to post more, I have removed my threadjack from isomage's post and am following up here....
I tried to open an image location directly into gimp to run my script on it but gimp wouldn't play nice, I assume it doesn't like the url structure even though it is a well formatted png....
...so I created an .htaccess on my server with a little php script redirect that will take a url like this http://blahblah/cave_50.png and parse out the number and pass it as a parameter to your cgi script, also putting in a random seed each time...
Gimp likes that url structure, so I tossed in a "Use a random base from Isomage's website" along with a size slider to my script, and it will go out, pull in a random cave image and process it all in one step....
Not something I'll make public but it sure makes for a neat concept!
-Rob A>