updated set_image_url function