The best thing to do when trying to Optimise Images is to use Google's PageSpeed Insights. They offer you an option to download optimised image, JavaScript, and CSS resources for the page.
This will automatically download all images that need optimising to Google's level of optimisation.
Example Below:

In regards to your Leverage Browser Caching, all you need to use in your .htaccess
file is:
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
## IMAGES ##
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/x-icon "access plus 1 year"
## CSS ##
ExpiresByType text/css "access plus 1 month"
## HTML ##
ExpiresByType text/html "access plus 1 month"
## JAVASCRIPT ##
ExpiresByType text/javascript "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
ExpiresByType application/json "access plus 1 month"
ExpiresByType application/x-javascript "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresDefault "access plus 1 month"
</ifModule>
and for external JavaScript files, see my answer to this question: Leverage browser caching for 3rd party JS.