fix output.pgm