core: refactor depiction lookup. Fix duplication of preview images.

(cherry picked from commit 74dd789fc1b91ec6be3b58d67123cf3ca7a7a79b)