Small refactor of javascript. Href on image