realize I need to pad the input image, as padding buffer is not enough