I'm trying to use the following htaccess to deny url access to images on my site:

order deny, allow
deny from all
allow from localhost

Supposedly it should block everyone from viewing my site's image files but allow the pages to show them. However, I am getting broken image links - apparently, the htaccess does not recognize the webpage to be "localhost". Any ideas?