Update functions to handle uploading images to mysql.