How can I get the current category image from outside of the category template (view.phtml)?
for example if I wanted to get it from header.phtml or footer.phtml.

I tried copying the code from view.phtml:

```
<?php
$_helper    = $this->helper('catalog/output');
$_category  = $this->getCurrentCategory();
$_imgHtml   = '';
if ($_imgUrl = $_category->getImageUrl()) {
$_imgHtml = '<p class="category-image"><img src="'.$_imgUrl.'" alt="'.$this->htmlEscape($_category->getName()).'" title="'.$this->htmlEscape($_category->getName()).'" /></p>';
$_imgHtml = $_helper->categoryAttribute($_category, $_imgHtml, 'image');
}
?>

```

but i get this error when reloading the page:
 Fatal error: Call to a member function getImageUrl() on a non-object