public void deletePicture (String  filePath){
		Picture picture = findById(filePath);
		if(picture.getPath().equals(filePath)){
			List<? extends TagI> tags = picture.getTags();
			for(TagI tag: tags){
				beginTransaction();
				List<? extends PictureI> pics =tag.getPictures();
				pics.remove(picture);
				tag.setPictures(pics);
				if(pics.isEmpty()==true)
					entityManager.remove(tag);
				commitTransaction();
			}

			Album album = picture.getAlbum();
			if(album!=null){
				beginTransaction();
				List<? extends PictureI> pics = album.getPictures();
				pics.remove(picture);
				album.setPictures(pics);
				if(album.getPictures().isEmpty()){
					entityManager.remove(album);
				}
				commitTransaction();
			}

			try{
				beginTransaction();
				LocationI location = picture.getLocation();
				try{
				List<? extends PictureI>  picts = location.getPictures();
				picts.remove(picture);
				if(picts.isEmpty()){
					entityManager.remove(location);
				}else
					location.setPictures(picts);
				}catch(Exception e){
					Log.getLogger().log(Level.INFO, "Couldn't get pictures from Location" + location );
				}
			
			}catch(Exception e){
				Log.getLogger().log(Level.INFO, "Couldn't get location from Picture " + picture);
			}
			commitTransaction();

			Comment com = picture.getComment();
			beginTransaction();
			List<Picture> pictures = new ArrayList<Picture>();
			try{
				pictures = com.getPictures();
				pictures.remove(picture);
			}catch(Exception e){
				Log.getLogger().log(Level.INFO, "Couldn't get pictures from Comment " + com );
			}
			if(pictures.isEmpty() && com!=null){
				entityManager.remove(com);
				commitTransaction();	
			}else if(com != null){
				com.setPicture(pictures);
				commitTransaction();
			}
			beginTransaction();
			entityManager.remove(picture);
			commitTransaction();
		}
	}