Analyze images when exiting