I made the readImage function.