outputting png instead of pgm