ok no problem.
It wasn't clear, to me at least, from your initial post that you wanted a cumulative counter of all visitors' image clicks.
If you want to hide from your visitors the fact that you are counting their clicks then you could do the following:
2) The server side script then retrieves the current value of the counter from a database, increments it by 1 and then writes the new value back to the database.
3) You can then do whatever you need to do with the counter value in the db.
Using Ajax, you could run into problems with high traffic, rapid ajax requests from multiple users resulting in your db being bombarded. So beware of that possibility.
If you don't want to use ajax you could do the following:
1) Put the image in a html form with action="serverscriptiin2above"
But doing this the user will be aware something is going on as a result of whatever your server side script does after it updates the counter...ie..redirects back to the original web page or whatever.