Changed loadImage to load images as PIL, and convert to ndarrays to simulate the actual pipeline