I was custom developing a new feature for a Joomla! site and encountered a problem. I had piggy-backed the new feature on Joomla! content so I don’t have to code all administration aspect from scratch. But the display page I was custom coding to fit my client’s need.
The problem I had was that {mosimage} was always displayed literally, without being swapped out for the image itself. After some tracking and I found the line of code that does the magic:
$params->def( 'image', 1 );
After this parameter was set, {mosimage} was interpreted correctly.