PCX fixes: Additional header sanity check, fix memory leaks, add header logging.
Validate PGM, PPM, and PAM header MaxValue parameter.