Hi!
There are actually multiple ways to get to rome here
First one, maybe the easiest for you, is to install the "Regular Expressions" Markup plugin. There you can add a "from" and "to" rule for that replacement.
Second option is to use the "Content Rewrite" plugin, which acts a bit like regular expressions, but is more menu-guided and does not create custom file creation.
Third option is to modify a plugin like bbcode or textile to include a short tag for your [preimage] and [postimage] thingies?
Fourth option would be to use a plugin like the "Typeset/Extended Buttons" plugin to add a button for inserting your code into the entry immediately.
Last but not least: You could create your own little plugin that hooks on the required events (like the markup plugins all do) and push it so that your replacement is done there? This would have the upside of full PHP complexity.
Best regards and HTH,
Garvin