Image class: Renamed and implemented the 'writeToPPM' method.

As the PPM file format refers to color images, the PGM (Portable
Gray Map) is more suited to grayscale images.

The method was renamed to 'writeToPGM'.
Added bmp and pgm image formats to the gitignore list.
Image class: Fixed a bug in the 'writeToPGM' method.

The comment line did not start with a hashtag.