The $directory variable doesn't contain the correct value
if you want to find the folder of your theme you have to use something like this:

&lt;?php echo drupal_get_path('theme','your_theme').'/images/whateverfile.ext'; ?&gt;