Thermal partition function of photons and gravitons in a Rindler wedge