add image, update database and update file