find index of file instead of file itself to avoid searching it again
Merge branch 'image-links-refactoring' into unstable

* image-links-refactoring:
  find index of file instead of file itself to avoid searching it again