Pair production occurs when a photon with sufficient energy produces a particle and an anti particle. For this to happen with an electron-positron pair the minimum required energy of the photon has to be great enough to produce an electron and positron which I get to be around $1.6\times10^{-13}$J which is a gamma photon with a frequency of $2.46\times10^{20}$Hz.
When the pair is produced it then annihilates again and produces at least 2 photons to conserve momentum. These photons will be at a lower frequency as the energy is shared between them. From what I have researched, the probability of pair production occurring increases with photon energy.
If this is the case how come we observe cosmic gamma rays? Surely the photons that are emitted from the source will undergo pair production and annihilation at some point while propagating causing none of the original photons to reach us. How is it possible that we observe these and in our observations is pair production taken into consideration when calculating estimates for the emitted energy of the source?