fix uploadhook
fix bracket syntax
reset device, and specify filename for downloaded images.