public void fetchFiles() {
		int returnVal = this.chooser.showOpenDialog(null);
		if(returnVal == JFileChooser.APPROVE_OPTION) {
			File[] directorys = this.chooser.getSelectedFiles();
			for(int i = 0; i < directorys.length;i++){
				if(directorys[i].isDirectory()){
					String album = directorys[i].getName();
					File[] dirFiles = this.chooser.getSelectedFile().listFiles();
					for(int j = 0; j < dirFiles.length; j++ ){
						if(dirFiles[j].isDirectory()==false){
							/*find the pos of the . in the filename*/
							int pos = dirFiles[j].getName().lastIndexOf("."); 
							/*get extension name and place into string ext*/
							String end = dirFiles[j].getName().substring(pos + 1);
							if (isValidFileExtension(end) && dirFiles[j].isFile()){ 
								ImageObject imageObject;
								if(dirFiles[j].isDirectory() == false){
									imageObject = Metadata.getImageObject(dirFiles[j]);
									imageObject.setAlbumName(album);
									imageObject.setFileName(dirFiles[j].getName());
									imageObject.setFilePath(dirFiles[j].getAbsolutePath());
									this.imageObjects.add(imageObject);
								} 
							}
						}
					}
				}

				else{
					for(int k = 0; k < this.chooser.getSelectedFiles().length; k++){
						ImageObject  imageObject = Metadata.getImageObject(this.chooser.getSelectedFiles()[k]); 
						imageObject.setAlbumName(this.chooser.getSelectedFiles()[k].getParentFile().getName());
						imageObject.setFileName(chooser.getSelectedFiles()[k].getName());

						imageObject.setFilePath(this.chooser.getSelectedFiles()[k].getAbsolutePath());
						this.imageObjects.add(imageObject);
					}
				}
			}
		}
	}