например так
(function ($){
var galleryId = 0;
$.fn.stepCarousel = function ( options ) {
return this.each(function(){
var id = this.id;
if ( !id ) { id = this.id = 'gallery'+galleryId++; }
stepcarousel.setup( $.extend({}, options, { galleryid : id }) );
});
}
})(jQuery)