Check and set mime type when renaming