Umbraco Razor - checking if the imagecrop exists

if it fails a default image is written out.

@try

{

         @Html.Raw("<!--" + @mediaItem.CroppedImages.Find("@name", "imagesize").Count() + "-->");

         <img alt="@page.Name" src="@mediaItem.CroppedImages.Find("@name", "imagesize").url" />

}catch{ 

 <img alt="@page.Name" src="/images/default-image.jpg" />

}