If the main gallery is protected by a master password, the search dialog is still working, even if the visitor does not input anything. I recently modified the index.php of the standard theme to show a tag cloud (printAllTagsAs). Each visitor can click on the tags and it works, even if he did not input a password. Those functions should be disabled until the user input the correct password. Why you don't handle all the password stuff within the htaccess file(s)?