It confuses people that using "guess" and "valid" at the same time, also you will not get a 100% sure mimetype because you are using "guessTypeFromExtension" as well, so I would suggest that we just have the function name like "guessTypeFromFileProperties" without the redundant "valid" if you are just trying to distinguish the function names.