Need help regarding render

How to return image not found if bear is not in the picture in render bear classification problem??