Sliding Gallery PLEASE HELP :(

Hi there,
Ok, I have a sliding photo galley with a previous and next button. I have added action script to tell the linked pictures to slide along and for the next button its fine (I took the script from a forum…as you do). I put stop commands on the key frames over the next picture, Now if I am on the 4th image and click previous, its goes all the way back to the start!? I have attached the action script, I am new to flash or at least intermediate so you may have to talk down to me but if anyone can help I would kiss ya!

stop()
this.onEnterFrame = function(){
if(rewind == true){
prevFrame();
}
}
next_btn.onPress = function(){
rewind = false;
play();
}
prev_btn.onPress = function(){
rewind = true;
}