Searchlet.io Image Ordering Algorithm in Python: