imgsearch refactored