ImageReranker: optimize for speed the reranking function