update javascript resize image