One User did a search with editing inside the Gallery and in the logs stands many times
8: Undefined index: gallery_searchkeywords
...Themes/default/languages/Gallery.german.php (search_results sub template - eval?)
Line: 3769
I did a search in the code and the variable gallery_searchkeywords is never used.
In Gallery2.php stands the line
$context['gallery_searchkeywords'] = true;
I think the "s" is too much and must be
$context['gallery_searchkeyword'] = true;
in 4.0.8a Gallery2.php Line 4192 + 4225