Here's another way to think about a photon's gravity. Think of an enormous collection of photons.
Specifically, in the first 20,000 years or so after the Big Bang the universe is believed to have been radiation dominated, meaning that any large region of the universe contained far more mass-energy in the form of free radiation than in the form of matter. The gravity of this radiation caused the original expansion of the universe to decelerate dramatically. In fact, because radiation has positive "pressure" equal to 1/3 of its mass-energy (w=1/3), free radiation causes twice as much gravity (density + 3*pressure) as would the same amount of mass-energy in the form of matter. Relative to its total mass-energy, the early universe decelerated gravitationally at twice the rate it would have if it were matter-dominated.
Each photon's individual mass-energy and pressure decay through redshift, at a rate proportional to the expansion of the universe, 1/a. Which is why the universe is no longer radiation-dominated; by comparison, the mass-energy of an atom of matter does not decay in this way.