I was having some problems with image files being compressed by gzip on top of them being jpgs etc. In the end I am using the following code in my .htaccess file which applies gzip compression using php only on files with the following extensions htm¦html¦css¦js¦php. This seems to be working well and is showing around 70% reduction in file size.
php_flag zlib.output_compression on
php_value zlib.output_compression_level 6