corrected single line pgm file header reading bug

Previous PgmFile implementation did not support single line pgm header format
P5 698 961 255
Only multiline pgm header format was supported before
P5
698 961
255