Don't strip a dotted extension from the path unless it has a matching mimetype.