For the photon, there is no distance. That's what we keep telling you. Polymath did a great job of explaining this in a previous post. Here it is again:
1. The Earth: the star is 4 ly away, so light takes 4 years to travel. Time dilation factor is 1 (no shift). The galaxy is 10 million light years away, so it take light 10 million light years to travel.
2. A spacecraft going past Earth at 86% of the speed of light. Time dilation factor is 2 (all times and distances are divided by 2). In this frame, the star is 2 light years from Earth, so light takes 2 years to travel. The galaxy is 5 million light years from Earth, so light takes 5 million light years to travel.
3. A spacecraft going past Earth at 99.5% of the speed of light. Time dilation factor is 10 (all times and distances are divided by 10). In this frame, the star is .4=2/5 light years from Earth, so light takes .4 years to travel. The galaxy is 1 million light years from Earth, so light takes 1 million light years to travel.
4. A spacecraft going past Earth at 99.995% of the speed of light. Time dilation factor is 100 (all times and distances are divided by 100) In this frame, the star is .04 light years from Earth, and the light takes .04 years = 2 weeks to travel. The galaxy is 100,000 light years from Earth, so light takes 100,000 years to travel.
5. A spacecraft going past Earth at 99.99995% of the speed of light. Time dilation factor is 1000. In this frame, the star is now .004 light years from Earth and now takes .004 years = 1 1/2 days to travel. The galaxy is now 10,000 light years from Earth and the light from it takes 10,000 years to travel to Earth.
Notice how the distance keeps getting shorter the faster you go? That distance goes to 0 when you get to the speed of light.
For the photon, there is no distance. For you, there is a distance.