It should work because discord app uses electron, so it must be on purpose or oversight from discord's part.
Another reason could be that Discord caches images on its servers to hide viewer's IP from the original server hosting the image. The caching involves compression that sometimes breaks the image.