Fixes javascript for finding linked images