Using left and right keys

I’m using the command to use the left and right key and they work. but i’ve got a border which resizes depending on the image. when i use the left and right keys to navigate through the photo gallery the resizing borders get messed up. for example the 4 border needs to rezise to a smaller size, when using the keys it becomes the 5th one and then changes all the borders from the 5th one onwards. pls help!!!