Better logic for video index