Show no caption instead of "undefined"

If an image tag has no title, an ugly "undefined" is shown as a caption. This commit tests for undefined and will insert a blank string instead.