Since you're dynamically loading the mime mapper in the workaround below, please also load get unsed filename there, too.  That will make the patch more self-contained.