Refactor identification of relevant image references.