Match the mimetype of a file preferably by content
This helps with files that have the wrong extension; some website export .jpg images as .png files, it seems.