I have a jQuery script that creates a carousel to rotate images left and right on user click. At first, I wasnt planning on putting more than one carousel on a single page, but
Use the .parent() function go up a level. Your code might look something like this:
$('.right-button img').click(function() { carousel = $(this).parent(); //bunch of code }