Fixed bug that had background image saved and written to different locations.  Added some debugging ready for move to using 16 bit depth images, but sticking with 8 bit images for now.