Have You tried removing
+(n+1)+
from
jQuery(this).find("img").attr("a... + "' href='#'>"+(n+1)+"<\/a><\/li>");
I have no idea what you're asking though.