update the upload imsage sample function