Uses a better algorithm to make sure we know the mimetype and only downsize images on upload if requested [#915 state:resolved]
(cherry picked from commit 71de9ff6daa400f96d77a3e479b504c5cb56abc7)
tweak expFile for mimetype detection & navigation for external url