Display error message in static preview on error

If an error occurs while converting the input code to PNG image
for static preview, then create a PNG image to display the error
that occurred.