close to fixing visualize_images