Help with thumbnail gallery


I have this project I have been working on for a few days now, but I am stuck and am almost completely bald now from pulling my hair out. It is an image gallery with scrolling thumbnails that when you click them will load the larger images. However, I can not get that part to work. The thumbnails load and scroll, but when I click them I get an error message.

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at BannerVer3_fla:mcThumbsInside_6/imageLoadedThumbThree/BannerVer3_fla:gotoPage()[BannerVer3_fla.mcThumbsInside_6::frame1:124]

I have googled and searched and trolled fourms, and found lots of posts related, but have been unable to implement any of the fixes into my situation. Any help at all will be greatly appreciated.

This is the AS3 for the thumbnail image.

var fader:MovieClip;
var photos:MovieClip;
var loaderThumbThree:Loader;
function loadImageThumbThree([url:String):void]({
//Set properties for this loader
loaderThumbThree = new Loader();
loaderThumbThree.load(new URLRequest(url));
loaderThumbThree.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, imageLoadingThumbThree);
loaderThumbThree.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoadedThumbThree);
function imageLoadedThumbThree(e:Event):void {
//Load image
//Act as a button
mcThumbThree.addEventListener(MouseEvent.CLICK, gotoPage);
//Have hand crusor on hover
mcThumbThree.buttonMode = true;
mcThumbThree.useHandCrusor = true;
function gotoPage(e:MouseEvent):void {

Thanks in advance for helping this noob out.