Sets media type for images in the db.