@Override
	public void update(Observable arg0, Object arg1) {
		this.setTopButtonsVisibility(false);
		this.resetSlider();
		this.photoPanels = new ArrayList<PhotoPanel>();
		List<? extends PictureObject> images;

		if(this.cardPanel.getLayout() instanceof CardLayout){
			CardLayout cl = (CardLayout) this.cardPanel.getLayout();
			cl.show(this.cardPanel, "All");
		}

		this.photoViewPanel.removeAll();
		this.photoViewPanel.repaint();

		if(arg1 instanceof MainModel) {
			MainModel model = (MainModel)arg1;
			images = model.getImages();

			for(int i = 0; i < images.size(); i++) {
				PhotoPanel pp = new PhotoPanel(images.get(i).getPath());
				try{
					pp.setComment(images.get(i).getComment().getComment());
				}catch(Exception f){

				}
				try{
					pp.setTags(images.get(i).getTags());
				}catch(Exception f){

				}
				try{
					pp.setLocation(images.get(i).getLocation().getLocation());
				}catch(Exception f){

				}
				try{
					pp.setName(images.get(i).getName());
				}catch(Exception f){

				}

				this.photoPanels.add(i, pp);
				this.photoViewPanel.add(pp);
			}
			addListenersToAll();
		}

		if(arg1 instanceof Files){
			images = Files.getInstance().getPictureList();
			for(int i = 0; i<images.size(); i++) {
				PhotoPanel pp = new PhotoPanel(images.get(i).getPath());
				try{
					pp.setComment(images.get(i).getComment().getComment());
				}catch(Exception f){

				}
				try{
					pp.setTags(images.get(i).getTags());
				}catch(Exception f){

				}
				try{
					pp.setLocation(images.get(i).getLocation().getLocation());
				}catch(Exception f){

				}
				try{
					pp.setName(images.get(i).getName());
				}catch(Exception f){

				}
				this.photoPanels.add(i, pp);
				this.photoViewPanel.add(pp);
			}
			addListenersToAll();
		}

		if(!this.photoPanels.isEmpty()){
			for(int i = 0; i < this.photoPanels.size(); i++){
				Image image = this.photoPanels.get(i).getIcon().getImage();
				float scale = Constants.PREFERRED_PICTURE_HEIGHT/image.getHeight(null);
				BufferedImage bi = ImageUtils.resize(image, Math.round(image.getWidth(null)*scale),
						Math.round(Constants.PREFERRED_PICTURE_HEIGHT));
				ImageIcon icon2 = new ImageIcon(bi);
				this.photoPanels.get(i).setIcon(icon2);
				this.photoPanels.get(i).setScaleDimension(new Dimension(Math.round(image.getWidth(null)*scale), 
						Math.round(image.getHeight(null)*scale)));
			}
		}

		this.frame.revalidate();
	}