PGM image processing with g++