TIMOB-17567-additional fix to get right mimetype from stream