Fix for PR 1119.

A Jasmine test was falling. It went unnoticed. The PR was merged. This
is a fix for it.
Merge pull request #1154 from edx/valera/fix_failing_jasmine_test_return_correct_caption_index

Fix for PR 1119.