Update ts_install_helpers_generate_image() to cache images.