fixes for bugs arising for image convolution