finished writing the image output code. PMS2 format saves the images separately and all images are saved as png files.