guess mime type based on path
Try to determine the mime type of a file first based on its path, then based on its content.
The previous behavior (looking only at the file content) inferred a
mime type of text/xml for .svg files (instead of image/svg+xml)
which prevented them from being shown when embedded e.g. in a markdown
document.
review: Avoid adding a new crate for path detection
rebase onto master
fix commit message