Refactoring. Change image search function.