An ultrarelativistic approach to derive the photon rest-mass as a function of wavelength