The total energy $E$ of a particle is given by $$\tag{1}E=\sqrt{(pc)^{2}+({mc^{2}})^{2}}.$$ We also have
$$\tag{2}E=\gamma mc^{2}.$$
For photons, if we plug $m=0$ in the first equation, we get the correct formula describing its energy: $E=pc$. Whereas if we do the same in the second equation, we get an indeterminate form (since for photons $\gamma =\infty$ and $m=0$, we get $E=0\times \infty$).
Why do these two equations disagree for the photon even though they are algebraically equivalent?
I don't really have a sophisticated background in math, so an explanation that doesn't involve four-vectors would be greatly appreciated.
N.B. I've already went through this post, but all the answers relied on advanced math (four-vectors, Minkowski metric...).