Fixes to the search command

The search command did not work correctly; these fixes are needed to see contact pictures in the mail view in roundcube 0.9.