As the documentation for glm() explains, the aic component of the value returned by glm() is not a valid AIC:
For gaussian, Gamma and inverse gaussian families the dispersion is estimated from the residual deviance, and the number of parameters is the number of coefficients plus one. For a gaussian family the MLE of the dispersion is used so this is a valid value of AIC, but for Gamma and inverse gaussian families it is not.
Thus a valid AIC needs to obtained in some other way.