I would go about this using .htaccess files and making sure the referrer is coming from your site, rather than none or someone elses.
I'm not too good with the syntax of .htaccess, I only do it once in a blue moon, but there are some good tutorials out there if you google for it.