Image Generation as a Visual Planner for Robotic Manipulation