fix upload image bugs