make image download code work