simplify the image writing pipeline