Is there an algorithm to compare several pictures?
It looks like you are looking for algorithms for Content-Based Image Retrieval. As long as you don't expect any miracles, you should be quite happy with a colour histogram approach. Have a look at MPEG-7 colour descriptors.