Crucial  bug fix

Fix a bug of violation of index when selecting image scales. It appears
and causes crashes under low match number situation.
Merge branch 'master' of https://github.com/Zhe-LIU-Imagine/KVLD