You can use the toggle-event API to use two functions: one to change from thumb to large, the other to change from large to thumb. By using toggle, it will alternate between the two each time the user clicks.
If you want to try the class method, you can do this:
$('img').on('click', function(){
if ($(this).hasClass('thumb')){
$(this).removeClass('thumb').addClass('large');
//set your large image here
} else {
$(this).removeClass('large').addClass('thumb');
//set your thumb image here
}
});
The bonus here is that you can use CSS to make any changes to accommodate the large image or thumbnail.