Removed PIL dependency in favor if imghdr