pdImage, pdLayer: new functions for estimating RAM usage

To protect against memory leaks, it's important to compare expected
memory usage against reality.  Individual images and layers can now
provide such estimations.
pdDebug: integrate into PD's core image load function

This was the most important pdDebug integration prior to the 6.4 beta,
as potential program instability is (obviously) tied to the images the
user works with.  The information pdDebug now logs at image load time
should be a huge help in deconstructing program issues.