fix "curl: fail to write body" error
webputimage.py: handle cookies properly