Where does mass go when energy is converted in to photons?

If matter and anti-matter annihilate each other they emit a photon with the energy that corresponds to the mass, right? This is the best example I could think of matter/energy being converted directly in to photons. Now, if a photon doesn’t have mass (because it goes at the speed of light) where does all that mass from the matter and anti-matter go? Doesn`t it break the law of conservation of mass? If photons have energy why dont they have mass?

From a relativistic point of view, the energy of a particle with mass $m$ and momentum $p$ is given by: $$E^2=m^2c^4+p^2c^2$$ where $c$ is the speed of light. You can clearly see that a massive particle will have some mass energy $E_0=mc^2$, but also some kinetic energy.
The photon being massless, the above equation reduces to: $$E_\gamma=pc$$ One consequence of this equation is that if a photon exists, i.e. has a non-zero energy, it must be moving.
There is no "conservation of mass" law in physics - instead, we use the more general concept of conservation of energy (since from the first equation above, mass can be understood as a form of energy). The energy of the photon is related to its frequency by the Planck-Einstein relation: $$E_\gamma=h\nu$$ where $h$ is Planck's constant and $\nu$ is the frequency of the associated electromagnetic wave (remember that the photon is "the particle of light", i.e. an excitation of a field). Since you know the speed of light, $c$, and its frequency $\nu$, you can also derive its wavelength: $$c=\lambda\nu$$ And the energy of the photon can then be expressed as: $$E_\gamma=h\nu=\dfrac{hc}{\lambda}$$ Finally we get: $$E_\gamma=pc=\dfrac{hc}{\lambda}\Longrightarrow \lambda=\dfrac{h}{p}$$ which is nothing else than the de Broglie wavelength, and the basis for quantum mechanics. Indeed, this postulates that a particle (not necessarily massless) with momentum $p$ can be represented as a wave with wavelength $\lambda$.