fixing bug where if keyframe size is smaller than n_candidates_, graph generation crashes