Aligning of images using by changing the borders