using bilinear interpolation for resizing