Added mime type detection