Currently I am working on a custom theme (sorry I forgot to mention that in the original post).
I did some testing (using both my custom theme and a copy of the "basic" Zenphoto theme) and found the isImagePage and isAlbumPage functions work (hides the div if no images/albums are to be displayed) unless I am using:
setOption('albums_per_page', XX, false)
And
setOption('images_per_page', XX, false)
However, both my theme and the "basic" theme work if I set these options through the Zenphoto theme options rather than using "setOption".
I guess I will have to use the theme options to set values suitable for the search results and override them wherever I need a different value. Thanks for all of your help, I really appreciate it