fix function if python knows the mimetype