The default implementation of the decoding adds the artifacts.
This tool uses more clever math to replace what's missing: https://github.com/victorvde/jpeg2png