Load image with preloader from database

Hello, I’m wondering if someone can help me out. I’m looking to load an array of image urls from a database via php and use that to generate a simple photo gallery. The images need to be continually updated so the url for each image will be stored in a database along with some relevant text data so it can be handled it easier. I am wondering if it is possible to load up an array of image urls from a database and use that array to create a simple next/back photo gallery where each image has its own individual preloader. It would be like this http://www.kirupa.com/developer/mx/photogallery.htm but the array would come from a php array variable and there would be individual preloaders for each image. Thanks for the help.