How to reference the correct static file in phoenix

I have asked this question on stack overflow, but am thinking that this is probably a better place for it.

The question has been asked here: https://stackoverflow.com/questions/49406666/reference-the-correct-static-file-in-phoenix

In a phoenix project, I can reference digested img in a css file with:

background-image: url("/images/phoenix.png");

and that references:

http://localhost:4000/images/phoenix-5bd99a0d17dd41bc9d9bf6840abcc089.png?vsn=d

I would like to reference the same file, but the image src added with javascript, like so:

document.querySelector('#my-img').src = '/images/phoenix.png';

But this only references:

http://localhost:4000/images/phoenix.png

How can I configure the phoenix endpoint to instead serve the digested img file?

(I would like this functionality for updating cached file purposes)