Ward Identity makes QED logarithmic divergent

==Question==
Quick question regarding superficial degrees of freedom and Ward identities.
For instance in Peskin and Schroeder it is stated that the photon-self energy is superficially quadratically UV divergent but due to the Ward identity it is only logarithmically divergent. I don't see this argument.
The self-energy is given by
\Pi^{1-loop}=(g^{\mu\nu}p^2-p^\mu p^\nu)\Pi(p^2)
How does the Ward identity, or in other words, gauge invariance kill of the divergences?
Best,
A friendly helper 
====Comments==== 
==Answers==
===Answer 1=== 
Ok, I answer it myself. The reason is as follows; Based on gauge invariance the self-energy at one loop has to look like 
 \Pi=(g^{\mu\nu}p^2 A -p^\mu p^\nu B) 
 
where A and B are the explicit divergences not yet determined. However, in an explicit loop computation the first term does only arise with a divergence in D=2 whereas the second with a divergence in D=4 and not worse. But in order for gauge invariance to be true $A=B$ has to hold, i.e. the divergence is actually only in four dimensions and not in two. 
====Comments====