public void refreshTable(DefaultTableModel model, JLabel imageLabel, ArrayList<Photo> photos) {
		for (int r = model.getRowCount()-1; r >= 0; r--) {
			model.removeRow(r);
		}
		for (int a = images.size()-1; a >= 0; a--) {
			images.remove(a);
		}
		
		//Iterator it = GuiView.control.getCurrentUser().getAlbumList().get(currentAlbum).getPhotoList().entrySet().iterator();
		Iterator it = photos.iterator();
		
		while (it.hasNext()) {
			//Map.Entry<String, Photo> pairs = (Map.Entry<String, Photo>) it.next();
			Photo It = (Photo)it.next();
			//System.out.println(It.getName());
			try {
				Image image = ImageIO.read(It.getPic());
				images.add(image);
			} catch (IOException e1) {
				e1.printStackTrace();
			}
		}
		
		ArrayList<ImageIcon> icons = new ArrayList<ImageIcon>();
        for (int x = 0; x < images.size(); x++) {
        	double w = images.get(x).getWidth(null);
			double h = images.get(x).getHeight(null);
			double h2 = 100 * (h / w);
			Image s = images.get(x).getScaledInstance(100, (int) h2, 0);
        	//Image s = images.get(x).getScaledInstance(130, 130, 0);
        	ImageIcon p = new ImageIcon(s);
        	icons.add(p);
        }
        int row = 0, col = 0;
		model.addRow(new Object[] {"", "", "", "", ""});
		for (int i = 0; i < icons.size(); i++) {
			model.setValueAt(icons.get(i), row, col);
			if (col == 4) {
				model.addRow(new Object[] {"", "", "", "", ""});
				row++;
				col = 0;
			}
			else
				col++;
		}


		if (images.size() != 0) {
			double w = images.get(0).getWidth(null);
			double h = images.get(0).getHeight(null);
			double h2 = 270 * (h / w);
			ImageIcon i = new ImageIcon(images.get(0).getScaledInstance(270, (int) h2, 0));

			imageLabel.setIcon(i);
			picturesTable.revalidate();
		}
	}