I suspect your problem occurs due to some scaling issues. Basically you need to normalize your research image to the pattern template by subtracting the mean value of the template. And it is better calculate the ratio of correlation to the standard deviation of both images.
I don't know which programming language you are using. I wrote a Matlab code for you to better get what I meant above (note that I did not use zero padding since I work on the spatial domain, I don't think it is the issue that caused your spurious correlation too):
file1='https://lh3.googleusercontent.com/-GQSrln7qnO8/UtCT8elB_FI/AAAAAAAAEaw/bh7aKyyMRIo/s512/subimage.png'; % Research image
file2='https://lh5.googleusercontent.com/-YaDK_1QvqIQ/UtCT6-rNkNI/AAAAAAAAEao/41MOQJ_bXxU/s512/pattern_grey.png'; % Template pattern image
I2=I2(:,1:32); %% No padding
It=double(I2); % template
Ii=double(I1); % image
Ii_mean = conv2(Ii,ones(size(It))./numel(It),'same');
It_mean = mean(It(:));
corr_1 = conv2(Ii,rot90(It-It_mean,2),'same')./numel(It);
corr_2 = Ii_mean.*sum(It(:)-It_mean);
conv_std = sqrt(conv2(Ii.^2,ones(size(It))./numel(It),'same')-Ii_mean.^2);
It_std = std(It(:));
S = (corr_1-corr_2)./(conv_std.*It_std);
What you get:
You can observe the correlation peak at 17th row, 450th column, which is the position of your pattern in original image.
You can also use Matlab built-in function
normxcorr2(It,Ii);, just note that this function results in the correlation map with the sum of the lengths of two images, while my code provides you the correlation map the same size of your research image.