Rework image finding logic