Check for truncated image files during download.

The upload servers appear to randomly drop connections in the middle of
a download.  Check and retry the request if necessary when this
happens.

Change-Id: I80d9a0a030f04528d4809102dbc8a20e8cdc5c7e