Yeah, this is one of the big advantages to using image placeholders in fact. Since the compiler has a built-in search and replace system, anything that is text can be modified on the fly, and since image placeholders are text—everything about them can become dynamic. Replacements can be saved per format so that PDF does one thing while ePub does another.
If you’ve never edited a Format before (you just click on “Ebook” in the sidebar or whatever), then just double-click on the one you use to duplicate and edit it. There are actually two different Replacement tables, one for your project in general, and then each saved Format can have its own. For what you’re describing it is the latter that will suit you. But the main bulk of documentation on how to use them is found in the discussion on general project Replacements, in §23.4.4 of the user manual PDF.
Also, consider using different images for each format, that are optimised to the right size depending on the output, instead of having one single image that you inflate or shrink. The quality of this can vary widely depending on the device displaying the book. Your image may be blurry or pixelated in some cases. But if you create different images that are the right size to begin with, in theory it should be crisp and sharp in all cases.
And of course since the file name in the image placeholder is text, it would be the name you are adjusting with Replacements, rather than the width and height (and you can in face leave that off entirely since you’ve sized them correctly already). For example you type in this:
<$img:separator>
The compiler turns it into this:
<$img:separator-epub>
Or:
<$img:separator-pdf>
So long as you have image variants named “separator-pdf” and “separator-epub” in your binder, that’ll work.
Of course another approach entirely is to use Separators in the compiler, and break down the text of your outline even further. This is the “scene file” approach that is demonstrated in the novel template for example, where it is intended that each scene in a chapter has its own section—and then the compiler is responsible for inserting the separator. It may be blank space, or it could be an image placeholder too.
Of course if you’re doing it that way, then your Format’s separator can be tuned to use the right placeholder directly, rather than search and replace. And now you don’t have to litter your book with these codes, too, while writing.