I would like to get some ideas how to fix the given image (specific solution) using frequency domain and fft.
the image:

We can see that the image consist of 2 translated images and we want to translate them back. I know that i need to use the fact :

I tried something like that (matlab code), but it's clearly that I am wrong:
FileName='dog.tif';
%--- Read Image ---
im = readImage(FileName);
imshow(im);
%--- apply FFT on the given image ---
fftIm = fftshift(fft2(im));
%--- apply LOG and abs for plotting the transform ---
fLog = log(1 + abs(fftIm));
%----modify the image in the frequency domain-------
fftImMod=fftIm;
x=24; %x distance between the 2 images
y=4; %y distance between the 2 images
dimIm = 305; %the dimensions of the image NxM = 305x305
for j=1:size(fftIm,1)
for k=1:size(fftIm,2)
fftImMod(j,k)=fftIm(j,k)/exp((-2*(pi)*i)*(j*x + k*y)/dimIm);
end;
end;
%--- apply LOG and abs for plotting the reduced transform ---
fLogAfterMod = log(1 + abs(fftImMod));
%--- return to the image space ---
result=ifft2(fftshift(fftImMod));
% --- display results ---
colormap(gray)
subplot(2,2,1),imagesc(im); title('Original Image')
subplot(2,2,2),imagesc(fLog); title('Fourier Image')
subplot(2,2,3),imagesc(fLogAfterMod); title('Fourier of modified image ')
subplot(2,2,4),imagesc(real(result)); title('Result Image')
the output:

I hope the question is clear... I'm new in Image Processing and very confused..
thanks!