Add error handling for skipping images due to illegal filenames.
Add debug option to ImgWriter