We can solve this problem by using jQuery. There is an event "error" which we can use to solve the problem of broken images in website. It is called when element doesn't properly. You can understand it better by referring below example and implement in your website.
this.src = "http://www.webonsky.com/assets/front/resources/images/user_default_small.png";
this.src = "http://www.webonsky.com/assets/front/resources/images/user_default_big.png";
else if(this.alt == "topic")
// this.style = "display:none"
this.src = "http://www.webonsky.com/assets/front/resources/images/topic_default.png";
this.src = "http://www.webonsky.com/public/images/listing_img.jpg";
Here I have mentioned three conditions that is not required in every case. It is upto you how you utilize the event handling.