Comparing Images by Defining a Reference Model
When looking at your data I want to say that when you have a good image the intensity along the x axis will be somewhat symetric and be much more random when you have a bad image. 
The third order statistical moment, the skewness (1rst and second being mean and variance), is a good measure of assymetry. You may want to compare your image based on the skewness of the intensity along the x axis. Set some thresold either manualy or with basic machine learning.