FBGallery bug with jquery

I had a problem with this extension using jquery version 1.6.1

When clicking on an image it should enlarge in a lightbox. I was getting this javascript error:

I discovered the solution here:

unfortunately, I can’t post the link of where I got it :(

apparently I’m too new.

I fixed by changing

Line 462 in FBGallery.php from