libsbig: correct PGM maxval
libsbig: write PGM in network byte order