make file pgm.m into readpgm.m and writepgm.m