Suppose we have a conducting grounded hollow sphere of radius $R$, and suppose that we have a point charge $q$ located at a distance $d$ from the centre of the sphere. $(d < R)$.
How can the electrostatic energy of this system be expressed?
On the one hand I could sum over the potential-charge product: $$U = \frac{1}{2}\int_{sphere}\varphi QdV + \frac{1}{2}\varphi_q q$$ and then reason that since the potential of there sphere is $0$, I need only consider the second term, for which the potential can be calculated from that induced by the appropriate image charge.
On the other hand, I could argue that since the potential of the sphere is $0$, all of the energy is the work sunk into bringing a point charge $q$ from the surface of the sphere to its destined location, at distance $d$ from the centre.
However, since the image charge occupies the same space as the charge $q$ when the latter is on the sphere, the appropriate integral expressing this work diverges.
Are any of these two approaches correct? Can the arguments in either approach (potential summation and/or work of system assembly) be 'fixed' so that they lead to the correct answer?
For clarity's sake I'll note that in all literature I am familiar with the self-energy of point charges is taken to be $0$ by definition. I am looking for a solution to this problem with that assumption taken into account.