I've made a few improvements to the plugin, including allowing custom extensions to be specified, and uploading to the server when an image is linked. I had some issues when in the downloading case: The post would be parsed, and the local url would be returned, but it was before the file was actually downloaded, so the image would show up as broken when you post an image. The way I resolved it was using the websockets, and signaling the client when the file was finished downloading.
I welcome any comments or concerns about the code, especially before I publish it to npm. I do still have a few more ideas for this plugin (progress bar, maybe making an option where the conversion to a local url can be made permanent, imgur uploading)... I remember that @psychobunny mentioned incorporating a CDN but that sounds like something for a separate plugin, to handle all other types of uploads.