Fix to switch mimetype if the new file has a different mimetype.