mimetype check should not keep files open
utilize mimetype from type, don't keep file open