@Override
			public void actionPerformed(ActionEvent arg0) {
				if(arg0.getSource() instanceof JButton){
					JButton btn = (JButton) arg0.getSource();
					JPanel panel = view.getSinglePhotoPanel();
					PhotoPanel pp = view.getCurrentPhotoPanel();
					List<PhotoPanel> ppList = view.getPhotoPanels();
					if(ppList.contains(pp)){
						panel.removeAll();
						if(btn.getText().equals("Previous")){
							if((ppList.indexOf(pp) - 1) < 0){
								pp = ppList.get(ppList.size() - 1);
							}else{
								pp = ppList.get(ppList.indexOf(pp) - 1);
							}
						}
						if(btn.getText().equals("Next")){
							if((ppList.indexOf(pp) + 1) >= ppList.size()){
								pp = ppList.get(0);
							}else{
								pp = ppList.get(ppList.indexOf(pp) + 1);
							}
							
						}
						Image image = pp.getIcon().getImage();
						float scale;
						BufferedImage bi;
						if(image.getWidth(null) > Constants.MAX_PICTURE_WIDTH){
							scale = Constants.MAX_PICTURE_WIDTH/image.getWidth(null);
							bi = ImageUtils.resize(image, Math.round(Constants.MAX_PICTURE_WIDTH),
									Math.round(image.getHeight(null)*scale));
						}else if(image.getHeight(null) > Constants.MAX_PICTURE_HEIGHT){
							scale = Constants.MAX_PICTURE_HEIGHT/image.getHeight(null);
							bi = ImageUtils.resize(image, Math.round(image.getWidth(null)*scale),
									Math.round(Constants.MAX_PICTURE_HEIGHT));
						}else{
							bi = ImageUtils.resize(image, image.getWidth(null), image.getHeight(null));
						}
						pp.setScaleDimension(new Dimension(bi.getWidth(), bi.getHeight()));
						ImageIcon icon2 = new ImageIcon(bi);
						pp.setIcon(icon2);
						panel.add(pp);
						panel.repaint();
						panel.revalidate();
						view.resetSlider();
					}
				}
			}