change an img clicked when ajax start

change an img clicked when ajax start

Hi. I can't figureout how to do this.
I have 1 img when you click on it start an ajax call that call a php script. I know the ajaxStart function but what I have to do for having that when I press the img, it replace this with a loading gif and when the call is complete replace with the original img?
Thanks