fixed a bug in uploading image