Instead of checking size, you should try something like this:

`<a:ext {% if width != None %}cx="{{ width }}"{% endif %}{% if height != None %} cy="{{ height }}"{% endif %}/> `

Then instead of defaulting `width` and `height` to `0`, default them to `None` instead.