What prevents photons from getting mass from higher order Feynman diagrams The Higgs boson and gluons have no electric charge and photons couple to charge, so there is no tree level interaction between them and photons.  But what prevents higher order diagrams from contributing a non-zero mass term to the photon, for instance

where a photon couples to some fermion (say an electron, or a top quark) which can interact with the Higgs field.   Or consider that same diagram but with quarks and a gluon interacting between them? Or any higher diagram with even more loops?
I have heard charge conservation depends on gauge invariance, which in turn depends on photons being massless.  So it appears the photon has no mass, and these diagrams must all cancel somehow.  So I'm hoping there is a very nice symmetry explanation for why they all disappear, but if I say "because of gauge invariance" that would be circular logic, so there must be another symmetry at stake here?

What prevents photons from obtaining a mass from high-order self-energy loop diagrams?

 A: I'd like to give a different point of view than the one provided in Qmechanic's answer.
 The reason is not because of gauge invariance. Indeed, gauge invariance is just a statement of redundancy and it can't possibly have any physical consequences. 
My answer is instead the following: the photon is massless because it has just 2 degrees of freedom while being of spin-1. This is a statement completely independent of perturbation theory, Feynman diagrams and, in fact, even QFT. It would hold in any relativistic quantum theory such as string theory. 
If doing perturbation theory one would be able to change the number of degrees of freedom it would signal an inconsistency of the theory (such as a violation of gauge invariance) or that the point we are perturbing around isn't a good approximation of what we want to describe (a massive photon involves extra degrees of freedom, i.e. the stuckelberg field aka the goldstone boson eaten in the Higgs mechanism which should have included for the start).
Phrasing it slightly differently, I am saying that is somewhat more transparent/physical defining a theory by specifying its physical degrees of freedom and their quantum numbers, than rather giving a local lagrangian and its redundancy (gauge invariance) to remove the extra stuff that isn't physical (such as the longitudinal extra mode associated with a would be photon mass).
Added in response to some comments 
I think it's best if I add few clarifying remarks about gauge invariance that may notoriously confuse people. 
Gauge invariance is nothing but a statement of equivalence of two theories. Theories A and B which are related by a gauge transformation are physically equivalent. If gauge invariance is broken perturbatively it means the two theories aren't really equivalent. For example, imagine you generate a mass term as the OP is imagining: the two theories with and without the mass term are physically distinct since e.g. now the electromagnetic interactions are either long or short range. In fact, one can always restore gauge invariance but at the prize of adding new degrees of freedom which indeed make the two theories distinct. For example, a theory with a photon mass $m^2 A_\mu^2$ can be made gauge invariance by adding an extra degree of freedom $\phi$, and then making $\phi$ physically irrelevant again by coupling it in a gauge invariance way, $m^2 A_\mu^2\rightarrow m^2(A_\mu-\partial_\mu\phi/v)^2$. Now, the theory contains in principle 3+1 degrees of freedom ($3$ from $A_\mu$ and $1$ from the $\phi$) but actually only $3$ are physical because of gauge invariance $A_\mu\rightarrow A_\mu+\partial_\mu\Lambda$, $\phi\rightarrow \phi+v\Lambda$ (for example one can fix the gauge by picking $\Lambda=-\phi/v$). The surviving 3 d.o.f are just the original d.o.f of a massive spin-1 particle. 
All in all, if you want to describe a theory with two d.o.f. such a for a massless spin-1 particle with a local lorentz covariant vector $A_\mu$, you need gauge invariance to remove the extra longitudinal d.o.f., to make them physycically equivalent. The implication is $m^2=0 \mbox{ (or spin-1 with d.o.f=2)}\Rightarrow \mbox{gauge invariance}$, and not the other way around, since I can always construct a gauge invariant theory with a mass term (i.e. for a 3 physical d.o.f for a spin-1 particle) as done above: $\mbox{gauge invariance}\nRightarrow m=0$ (that is spin-1 with 2 d.o.f.). If by doing perturbation theory you were to generating a mass term to the photon it means that the perturbed theory and the original theory are nothing alike, and you can't use $A_\mu$ to describe in a mathematically consistent way just two d.o.f. any longer. 
A: I) At the perturbative/diagrammatic level of photon self-energy/vacuum-polarization $\Pi^{\mu\nu}$ , the photon masslessness is protected by the Ward identity, which in turn is a consequence of - you guessed it - gauge invariance. For the explanation in the setting of QED, see e.g. Ref. 1.

Fig. 1: A one-loop contribution to the photon self-energy/vacuum-polarization. More generally, the 'bubble' in the middle could be 'filled' with higher-loop contributions.
A brief oversimplified explanation is as follows: Mass is associated with a Feynman diagram in Fig. 1 and its higher-loop counterparts. The Feynman diagram is built from Lorentz-covariant tensor objects. The Ward identity states, loosely speaking, that the photon 4-vector $k^{\mu}$ is perpendicular to the Lorentz tensor structure of the middle bubble part of the diagram. In the end only the bare propagator/tree diagram without any loops/bubbles survives, thereby rendering the photon massless.
II) It should perhaps also be mentioned that in the Higgs mechanism, the fact that the Higgs field $\phi$ transforms in the fundamental representation of the electroweak gauge group $SU(2)\times U(1)~$ leaves one of the four gauge bosons without a massterm in the Lagrangian - the photon, cf. e.g. Ref. 2.
References:


*

*M.E. Peskin & D.V. Schroeder, An Intro to QFT, Section 7.5.

*M.E. Peskin & D.V. Schroeder, An Intro to QFT, Section 20.2.
