more cleanup, generat write image form from json data