Reference metadata in markup> replace images with text

I’m compiling to Latex and replacing images (using the Markup options in the compiler) with: \includegraphics[width=\columnwidth]{<$filename>}. This has worked well so far but I now need some images to be smaller than column width so I’m trying to add some metadata to sort this out but I’m not having any luck.

First I created a list meta data called “fraction” with the default selection set to “1” so that normally I won’t have to change it, then I added an entry I can select “.4” so that when I need to I can select the smaller size.

Then I change my image replacement to: \includegraphics[width=<$custom:fraction>\columnwidth]{<$filename>}.

My problem is that the custom metadata tag just prints out as is on compile, rather than entering 1 or .4 depending on selection.

Also, my guess is that this metadata will be taken from the image in the binder, not the document which the image is contained within. This isn’t the end of the world but it would be more convenient if I could take that metadata from the document, is that possible?