Part of the complete image download function