I got an answer in irc, which worked fine for me.
#+ATTR_LaTeX: width=0.38\textwidth wrap placement={r}{0.4\textwidth} #+ATTR_HTML: alt="old index mech" title="Old index mech" align="right" #+begin_src emacs-lisp :exports results :results value raw (case (and (boundp 'backend) backend) (nil "") (latex "[[file:img/indexing-old.pdf]]") (html "[[file:img/indexing-old.png]]")) #+end_src
This selects the backend-based link when exporting while retaining the HTML and LaTeX attributes. Seems pretty simple.
source share