code: def download_worker_fn(scraper, img_url, pbar, status_flags, status_lock):
      
      failed = False
      size_failed = False
      try:
          scraper.download_image(img_url)
      except ImageDownloadError:
          failed = True
      except ImageSizeError:
          size_failed = True
      status_lock.acquire(True)
      if failed:
          status_flags['failed'] += 1
      elif size_failed:
          status_flags['under_min_or_over_max_filesize'] += 1
      status_flags['percent'] = status_flags[
          'percent'] + old_div(100.0, scraper.no_to_download)
      pbar.update(status_flags['percent'] % 100)
      status_lock.release()
      return True
docs: Stnadalone function that downloads images.