Only generate disk image when necessary