fix a bug of deleting img while being uploaded