Flash Photo Gallery Nan Error

Hi guys. I’ve spent the past hour looking through similar posts and couldnt find a solution to the problem i’m having.

I have tried the photo gallery tutorial and it works fine when it is in it’s own swf file.

However when I try to use the code in an interface I am creating I get a repeating NaN error when I click the forward and back buttons. The interface uses a number of frames to jump around to different functions and the photogallery is in its own frame on the root timeline. The photo mc is in this fram on the root timeline.

The original step works fine where it automatically loads the first image but the back and forward buttons cause a NaN error.

Was just wondering if anyone could help out please.