Symmetric functions for fast image retrieval with persistent homology