speed up image exist check and better logging