getFrames: increase index of frame in case we skip invalid frames