This works great, except I want to set the image as well. Now, I know I can set the default values in COS, but I want to set them at the template-level as this custom module will be used in different templates and the image will change. The problem is that it isn't clear how to set this, and I can't find any documentation about it anywhere.
Image fields appear to be dict type variables with the following properties:
src - image source URL
width - image width
height - image height
alt - image alternate text
Unfortunately the following code doesn't seem to work: