Bugfix #1099.

Details:
- bugfix #1099;
- improved getMimeType API call.
Merge pull request #1118 from alex-zen/bugfix

Bugfix #1099.