I have something like this in my httpd.conf:
RewriteCond "%{HTTP_REFERER}" !=""RewriteCond "%{HTTP_REFERER}""!^http://www.mydomain.com/.*$" [NC]RewriteRule "\.(jpg|png)$ - [F]
You might need to use this as well if you haven't used RewriteConds and RewriteRules before:
RewriteEngine On
I found it googleing or in the Apache Cookbook. Can't remember anymore.