improved image gallery search (fixes #188)

- correct search resetting after the user removed a search phrase
- correct multi word filtering
- correct iteration through the image list