Hi there you have miss understood the equation if a particle travell with speed of light then its mass would become infinity remember the equation
M'= Mo/(√1- V2/C2)
I read the FAQ about photons not having mass: https://www.physicsforums.com/threads/do-photons-have-mass.511175/
But De-Broglie's equation says that wavelength=Plank constant / mass x velocity
i.e.
λ=h/mv
inserting values in the above relation we find the mass of a photon having certain wavelength