public void initializeToPosition(final int contentIndex) {
        final int realPos = Math.max(-1, Math.min(adapter.getItemCount() - 1, contentIndex));
        this.allowOpenViewer();
        if (realPos >= 0) {
            this.scrollTo(categorizedImageListHelper.getListIndexForContentIndex(realPos));
        }
        this.post(() -> activity.startPostponedEnterTransition());
    }
initializes gallery to a certain position.
Use this method directly for gallery recreation if gallery was not available in activity's "onActivityReender" method
main/src/main/java/cgeo/geocaching/ui/ImageGalleryView.java