Bug 286867 Update demos and compatibility to use context#modify() instead of outputContext
examples/org.eclipse.e4.demo.e4photo/src/org/eclipse/e4/demo/e4photo/Thumbnails.java
images.add(resource);
					}
				}
				if (images.size() == 0)
					return;
				final int[] counter = { 0 };
				runnable = new Runnable() {
					public void run() {
						if (runnable != this) {
							return;
						}
						addImage((IFile) images.get(counter[0]++));
						if (gallery != null && !gallery.isDisposed()
								&& counter[0] < images.size()) {
							gallery.getDisplay().asyncExec(this);
						}
					}
				};
				gallery.getDisplay().asyncExec(runnable);
			} catch (CoreException e) {
				
				e.printStackTrace();
			}
		}
	}
	private void addImage(final IFile file) {
		 
		InputStream contents;
		try {
			contents = file.getContents();