Use this snippet of code to display an image when the featured image isn’t set. Works with images inserted in posts (and galleries!).
I found instructions on Oracle’s Java web site. However, they weren’t complete. This post lists all the steps needed to completely remove Java from your Mac.