@SuppressWarnings("unchecked")
	/**
	 * Moves a photo with given filename from one album to another.
	 * @return -1 = old album doesn't exist. -2 = new album doesn't exist. -3 = photo doesn't exist in old album. -4 = photo already exists in new album. 1 = succesful move of photo.
	 * 
	 */
	public int movePhoto(String filename, String oldAlbumName, String newAlbumName) {
		Photo p;
		
		if (GuiView.control.getCurrentUser().getAlbumList().containsKey(oldAlbumName) == false) {
			return -1; // old album doesnt exist
		}
		
		if (GuiView.control.getCurrentUser().getAlbumList().containsKey(newAlbumName) == false) {
			return -2; // new album doesnt exist
		}
		
		if (GuiView.control.getCurrentUser().getAlbumList().get(oldAlbumName).getPhotoList().containsKey(filename)) {
			
			if (GuiView.control.getCurrentUser().getAlbumList().get(newAlbumName).getPhotoList().containsKey(filename)){
				return -4; // photo already exists in new album
			}
			
			Iterator it = GuiView.control.getCurrentUser().getAlbumList().entrySet().iterator();
			while (it.hasNext()) {
				Map.Entry<String, Album> pairs = (Map.Entry<String, Album>) it.next();
				if (pairs.getValue().getPhotoList().containsKey(filename)) {
					pairs.getValue().getPhotoList().get(filename).removeAlbum(oldAlbumName);
					if (!pairs.getValue().getPhotoList().get(filename).getAlbums().contains(newAlbumName))
						pairs.getValue().getPhotoList().get(filename).addAlbum(newAlbumName);
				}
			}
			
			p = GuiView.control.getCurrentUser().getAlbumList().get(oldAlbumName).getPhotoList().get(filename);
			GuiView.control.getCurrentUser().getAlbumList().get(newAlbumName).addPhoto(p);
			GuiView.control.getCurrentUser().getAlbumList().get(oldAlbumName).deletePhoto(filename);
			
			
			return 1; //"Moved photo " + filename + ": " + filename + " - From album " + oldAlbumName + " to album " + newAlbumName;
		}
		else {
			return -3; //filename + " does not exist in " + oldAlbumName;
		}
	}