Updated mime functions
Added thread safe work queue