final page adding loop to add images into db