fix bug for resize image