s9e/autoimage is a Flarum extension that automatically turns image links into images. It only works on static links that end with .gif, .jpg, .jpeg or .png.
composer require s9e/flarum-ext-autoimage
Install with Composer then go to the admin panel and enable the extension.