Fix issue with receiving file as string, not ImageFile