Performance improvements.
1- Added a limit of 2000 to the search query when no segment is entered.
2- Added a preliminary segment filter to the initial search query.
3- Tested the data with an index on image title. Search with peripheral
images takes 45% less time.
Added image title index to the db.
Just some minor problems with segment search that were caused by the
last commit were solved.