Bugfix #1099.

Details:
- bugfix #1099;
- improved getMimeType API call.