private void addImagesInternal(final Collection<Image> images, final Func1<Image, String> categoryMapper, final boolean force) {

        //order images by category
        final List<String> categories = new ArrayList<>();
        final Map<String, List<ImageGalleryEntry>> catImages = new HashMap<>();
        for (Image img : images) {
            final String category = categoryMapper.call(img);
            if (!force && editableCategoryHandlerMap.containsKey(category)) {
                continue;
            }
            if (!catImages.containsKey(category)) {
                categories.add(category);
                catImages.put(category, new ArrayList<>());
            }
            catImages.get(category).add(new ImageGalleryEntry(category, img));
        }

        //add to gallery category-wise
        for (String category : categories) {

            if (!categorizedImageListHelper.containsCategory(category)) {
                createCategory(category, false);
            }
            adapter.addItems(categorizedImageListHelper.getCategoryInsertPosition(category), catImages.get(category));
            categorizedImageListHelper.addToCount(category, catImages.get(category).size());
        }

        //invalidate caches
        invalidateSpanIndexCaches();
    }
adds images for display to this gallery
main/src/main/java/cgeo/geocaching/ui/ImageGalleryView.java