<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def download_containers(self, to_download, current_options):
 """ Download the chosen containers on all the agents """

        if current_options["backend"] == "local":
            self._display_info("Connecting to the local Docker daemon...")
            try:
                docker_connection = docker.from_env()
            except:
                self._display_error("Cannot connect to local Docker daemon. Skipping download.")
                return

            for image in to_download:
                try:
                    self._display_info("Downloading image %s. This can take some time." % image)
                    docker_connection.images.pull(image + ":latest")
                except Exception as e:
                    self._display_error("An error occurred while pulling the image: %s." % str(e))
        else:
            self._display_warning(
                "This installation tool does not support the backend configuration directly, if it's not local. You will have to "
                "pull the images by yourself. Here is the list: %s" % str(to_download))