Fix jpeg resize issue