refactors image search