add database functionality to the image uploads