public static void addImageClick(final Spannable spannable, final Consumer<ImageSpan> clickAction) {
        //don't make images clickable which are surrounded by a clickable span, this would suppress the "original" click
        //(most prominent example: <a href> links with an <img> tag inside, e.g. for challenge checkers)
        final List<URLSpan> links = new ArrayList<>(Arrays.asList(spannable.getSpans(0, spannable.length(), URLSpan.class)));
        Collections.sort(links, Comparator.comparingInt(spannable::getSpanStart));
        int start = 0;
        for (URLSpan link : links) {
            final int end = spannable.getSpanStart(link);
            registerImageClickListener(clickAction, spannable, spannable.getSpans(start, end, ImageSpan.class));
            start = spannable.getSpanEnd(link);
        }
        registerImageClickListener(clickAction, spannable, spannable.getSpans(start, spannable.length(), ImageSpan.class));
    }
adds a custom click action to all images found in the spannable which don't have a click action already
main/src/main/java/cgeo/geocaching/utils/html/HtmlUtils.java