change resize from bilinear to box (faster)
small optimization
remove leak