private static void createState(final Bundle state, final List<Image> images, final int pos, final String imageContextCode) {
        state.putString(PARAM_IMAGE_CONTEXT_CODE, imageContextCode);
        state.putInt(PARAM_IMAGE_LIST_POS, pos);
        state.putInt(PARAM_IMAGE_LIST_SIZE, images.size());

        if (images.size() > IMAGELIST_INTENT_MAX_SIZE) {
            IMAGE_LIST_CACHE.clear();
            IMAGE_LIST_CACHE.addAll(images);
            state.putInt(PARAM_IMAGE_LIST_CACHEID, IMAGE_LIST_CACHE_ID.addAndGet(1));
            final int startPos = Math.max(0, Math.min(images.size() - IMAGELIST_INTENT_MAX_SIZE, pos - IMAGELIST_INTENT_MAX_SIZE / 2));
            state.putInt(PARAM_IMAGE_LIST_STARTPOS, startPos);
            state.putParcelableArrayList(PARAM_IMAGE_LIST,
                    new ArrayList<>(images.subList(startPos, startPos + IMAGELIST_INTENT_MAX_SIZE)));
        } else {
            state.putParcelableArrayList(PARAM_IMAGE_LIST, images instanceof ArrayList ? (ArrayList<Image>) images : new ArrayList<>(images));
            state.putInt(PARAM_IMAGE_LIST_STARTPOS, 0);
            state.remove(PARAM_IMAGE_LIST_CACHEID);
        }
    }
sets properties for activity to enable smooth image transation between master/list and detail activity
main/src/main/java/cgeo/geocaching/ImageViewActivity.java