Is energy always conserved?

How do you know that the energy of the photons doesn't accelerate the expansion by being transferred into the potential energy that results from the increasing distances between galaxies? Certainly the existence a transferral of the energy that we are not privy to seems more likely than the law of conservation of energy being inapplicable on a cosmic scale.