fixing bug with previous/next when only one keyframe exists