Use API for image downloads. Closes #668.