replace mimetype with media_type