better png/jpg detection
image fetching with retries and timeout