make sure pgm pixel values aren't too large (<= 255)