How to display custom taxonomy images on index.php?

Just like we use get_terms() to get all the terms in a custom taxonomy we can get all the taxonomy images with the below code. Place this code outside the loop to list all the taxonomy images.

$terms = apply_filters( 'taxonomy-images-get-terms', '', array(
    'taxonomy'     => 'ff-portfolio-tag',
) );
if ( ! empty( $terms ) ) {
    print '<ul>';
    foreach ( (array) $terms as $term ) {
        print '<li><a href="' . esc_url( get_term_link( $term, $term->taxonomy ) ) . '">' . wp_get_attachment_image( $term->image_id, 'detail' ) . '</li>';
    }
    print '</ul>';
}