I have created an attribute of type media image and now the attribute is showing in a Product Edit page in admin panel. For some products no image is selected for this attribute. I need to show any default image in the case where no image is selected. Because it is throwing an error on those product where this attribute doesn't have any value.
On front-end i am calling this image like this:
<img src="<?php $imprint_image_url = (string)Mage::helper('catalog/image')->init($_product, 'attribute_code')->resize(400,500); ?>">