Yogesh || Fix memory out of error by reading first 4 bytes rather than full file to detect the mime type