Boundary effects and the massless limit of the photon