Check out example codes for "if image is broken show alternative image angular". It will help you in understanding the concepts better.

Code Example 1

<img class="thumbnail-image" src="{{user.profile_image}}" onerror="this.src='assets/images/user.jpg'"  alt="alternative" />

Learn ReactJs, React Native from akashmittal.com