fix 2 bugs in uploadPic