Yeah, all the images get stored and can be used in other mosaics.
At the minute I'm just trying to get a feel for what the finished piece would look like, using different algorithms for matching the tiles... tbh I'm not sure this one is working very well, but its hard to tell until its finished.
I'm sure theres a script online already for this sort of thing but that would kind of defeat the point in doing it.
Funny you should mention the million dollar pixels thing, it was that that got me wondering how to make a photomosaic in php... my brain has a very interestingly arranged filling system, the strangest things get linked together.
I dont think its an idea that will ever make serious money again though... the whole idea and the way it works is hype generating more hype and it only works because of the hype. I have to say the guy's a marketing genius.