Added support for Portable Gray Map (PGM) and Portable Pixel Map (PPM)

I tried to match stye style of the rest of the library and use existing functionality where possible.
This implementation doesn't handle header comments or the ASCII variants (P2 and P3)