The phenomenon you're describing is a common source of confusion when first learning about special relativity. However, it is important to remember that special relativity does not apply to photons themselves, as they always travel at the speed of light in a vacuum.
Special relativity deals with the behavior of objects with mass and their relative motion. When an object with mass approaches the speed of light, it experiences time dilation and length contraction as observed by an external observer. However, for photons, these effects do not apply because they are massless particles.
From the perspective of a stationary observer, a photon does not experience time at all. This is because time dilation occurs due to the relativistic mass of an object, which increases as it approaches the speed of light. Since photons have zero rest mass, they are not subject to time dilation. Additionally, length contraction does not apply to photons because they are already traveling at the speed of light, and their motion is not measured relative to any observer.
So, while it is true that special relativity predicts time dilation and length contraction for objects with mass, it does not directly apply to photons. Photons are always observed to travel at the speed of light, regardless of the reference frame.