How to check whether a named Asset Transform exists? I'm using asset transforms in various places to serve appropriately sized images via a Twig macro that I feed an entry and the name of a transform into (the idea is to have the same bit of HTML, but with differently sized images depending on the context). The way I get the image URL is as follows:

entry.mainImage.first().getUrl(transform)

However, at the moment if the named transform is not found (ie. if the value of transform doesn't correspond to the name of an existing transform) I get a Craft error. For my purposes a better failure mode would be to just serve the untransformed, full-size image. I'm wondering if there's a way of checking whether a named transform exists? That way I could just set transform to null if it's not found and it should fail gracefully.
You can check for the existence of a transform within your controller (for example), as follows:

 if (craft()-&gt;assetTransforms-&gt;getTransformByHandle('jimbob')) {
      // Transform exists.
 } else {
      // Transform does not exist (null is returned).
 }


Unfortunately, there doesn't seem to be an equivalent service (such as craft.assetTransforms) for use within templates.

Stephen