now generating images and being nicer about memory