Adding functionality to properly save new images to database