The formation of giant planets in wide orbits by photoevaporation-synchronized migration