fix the image size issue when resize window