For the client-side, I'd use a toggle on the css class (for instance "checked" and "unchecked"). After the toggle took place, I'd read the resulting CSS from the element, and call a unique server-side method with an on/off param (a primitive boolean) to save the sate.
This way, you always sends the right value to your server, even if the user clicks a lot of time (and very fast) on the image. The last call will always make things right.