I feel this is more a front end question than a Bloomreach Experience question, but doing this this way is not responsive. I think there is a way to do this via CSS, but I am no expert on that.
I understand that I can use "media queries’ in CSS… I was just wondering if I wanted to change it on the server side if there was a recommended way to do it?
The example in the document is only for rich text fields (containing image links added by end users through CMS rich text editor), not for any other image links (added by end users through CMS link picker). In other words, if the document has a hippostd:html compound field and so it has a property getter for that, you may follow the example.
However, if the document has an image link property, you cannot use the technique in the example. In that case, your original approach seems okay, but you should not mix <@hst.html ... /> for a simple image (link) property.
Suppose document.heroimage is a link to an image and you want to generate an image src link from there. Don’t use <@hst.html /> there because the image link compound is different from hippostd:html compound field. Instead you can do the following for example: