The array is now working correctly. The code is currently stable and outputs the input image pixels, minus the border pixels. Convolution operation is yet to be added.