Dynamic jpg loading

Im making a new photogallery. When i go to load the jpgs dynamically the preloader is called just fine (which is the weird thing) it does its job, loads about 40k then when the image is supposed to be shown…nothing. It preloads the pictures but nothing shows up. Does anyone know what the prpoblem may be. Thanks