Pretty sure that you cannot achieve this with variables.
Variables are for string replacements in the WYSIWGY editor and
cannot be used for true code replacements.
Conditional tags are is one option particularly if you images
are different sizes.
If you images are exactly same size? then you may have other
options (e.g. replacing the project graphics before each compile).