load div after div after div ...

load div after div after div ...

Hi, 
I have a galery of n photos (could be 1000, 2500 or 5000).
I would like to load all the images names in one page with a loader image for each name. I can have 2500 names for example, with 2500 times the same loader.

And after, I would like to replace the first loader with the jpg of the first image.
As soon as the first jpg is loaded, the script replace the second loader with the image of the second images, and so on.

The goal is to load all the images names in one time and after, to load all the images, one after one, the fastest as it could be.

I don't want to use a timer because it might cost too much time.
Loading all the images at the same time result of display bugs (some images don't load).

Many thanks for you help, I'm lost and I realy need you !!!!

Vincent