fix notice for undefined variable index in exmedia module