fix bug for img upload