Copy and paste the following snippet in your theme’s functions.php file and it will let you prevent WordPress to compress your jpg files.

Snippet Source/Credit: WP Snippets