Though Mathematica will not have a specific function to solve your problem for you, it is completely conceivable that an algorithm can be written to address your analysis problem. It is not completely clear to me what you mean by "overlapping" in the examples that you give. I understand that generally you mean when two rectangles share a common area--but what I am not clear on is what determines how you place image 2 on image 1. In the examples that you give there are no cases where, a square say in image 2, exactly co-registers with a square in image 1, suggesting that you are moving image 2 continuously around on image 1. So, the devil of the algorithm needed is in the details of the requirements of your analysis. But given both, I;m sure that it can be coded in Mathematica.