added image output for visual inspection