If you're talking about static images, you can do this in your web server (apache/lighttpd/nginx/etc). If you're talking about dynamic images served by rails directly, you can set your own expires headers:
http://rails.rubyonrails.org/classes/ActionController/Base.html#M000272