Mode expansion and photon operators in dispersive and absorbing dielectrics