I just recently had a similar problem. To solve it, I added a .htaccess file to the directory with the images with the following content:
### activate mod_expires
ExpiresActive On
### Expire .gif's immediately (0) after they have been accessed (A)
ExpiresByType image/gif A0
### or set "ExpiresDefault" for all files in the directory