finished image generating and writing