A photon has no mass.
Converting all of a photon's energy into mass(or vice versa), you would equate these equations, giving hc/lambda = mc^2
m = h/(lambda * c)
The particle produced has mass, but is not a photon.(or the mass gets destroyed to produce a photon)