On the gravitational energy problem and the energy of photons