media type is guessed first from filename, then if it's not enough, the file is opened to try to guess type. If it still can be determined, None is returned.