This is racy. Another worker could pop the last item off the channel in the meantime. The fix is to do something like

``` go
go func() {
  for id := range c {
    img, layer, err := graph.getRemoteImage(stdout, <-idChan, authConfig)
    // ...
  }
}()
```