public void setPagesList(List<Page> list) {
		if (list == null)
			return;
		pagesList = list;
		ImageCache.getInstance().clear();
		for (Page p : pagesList)
			ImageCache.getInstance().preload(p.getUrl());
		index = 0;
		try {
			Image m = ImageCache.getInstance().get(
					pagesList.get(index).getUrl());
			for (PagesControllerListener l : listeners) {
				l.setPrevButtonEnabled(false);
				if (pagesList.size() > 0)
					l.setNextButtonEnabled(true);
				else
					l.setNextButtonEnabled(false);
				l.setPageCountNumber(pagesList.size());
				if (pagesList.size() > 0)
					l.setCurrentPageNumber(index + 1);
				else
					l.setCurrentPageNumber(0);
				l.setCurrentPageImage(m);
			}
		} catch (IOException e) {
			for (PagesControllerListener l : listeners)
				l.setMessage(e.getMessage());
			log.warning("Error while retrieving the first image.");
		}

	}