Made a common base class for both PNG and TIFF classes because they are almost identical. Some style updates.