A proper fix for that should probably to throw a more specific exception in such case and catch it where needed, but I'm afraid it could break API signatures.
This message was sent by Atlassian Jira (v9.3.0#930000-sha1:287aeb6)
If image attachments aren't displayed, see this article.