I tried the script on the Graphene theme directly, and it worked like a charm, both for categories and pages.
The script, which is basically a filter function, has to be pasted in the
functions.php file after the function named
graphene_get_header_image (i.e., after the
add_action command). By "after" I don't mean right after: the script should work as long as it is placed below the graphene_get_header_image function.
If you don't want to mix theme functions and custom functions in the same file, you could create a file called
user-functions.php in your theme folder, paste the script there, and insert this line of code at the end of
functions.php (before the php closing tag):
include_once (TEMPLATEPATH . '/user-functions.php');
If that doesn't work, you could try updating WP and Graphene, assuming this is an option for you, of course. If it isn't, there's one more thing you could try, which is disabling all the plugins to make sure they are not interfering with the loading of the images.