As Rob JefferiesJeffries says, the universe is mostly empty space. A photon can easily travel thousands of light years without interacting with anything. Most of the interaction would occur when photons entered the earth's atmosphere. The Hubble avoids this. These photos were most likely from combining several viewing sessions giving basically an extended time period for observing the galaxy.