fixed readPPMImage function