added determine_mimetype