Improved machanizm to check MIME type, whitespaces removed from received MIME before checking with patterns