Refine image download script