added support for image optimization (JPEG, PNG)