Applying a filter mask problem

Im new to CV and need help with something. If i have an image which has the values

Img = (25, 30, 45, 2,
5,45, 32 ,2
43,44 90, 12
35,35,31,5 )

and i have to apply the following filter on this image

Filter mask = ( 1, 2,1
2, 4, 2
1, 2, 1)

how do i do this because as the mask is 3*3 and the image is 4*4 how would i apply the filter in the image for the pixel position (2,2),(3,3),(2,3) and (3,2)

I understand first I should be using the padding mirroring and wrapping methods but i dont know how to do it.

What learning materials do you use? What do they say about the topic? How would you find better learning materials?

<> is what you need