public void setLocation(LocationGPSObject lo ,Picture picture){
		if(picture != null){
			if(!(lo.getLocation().equals("")) || lo.getLocation() != null){
				String place = "";
				try{
					place = lo.getLocation().toLowerCase();
					String s = lo.getLocation().charAt(0) + "";
					place = s.toUpperCase() + place.substring(1);
				}catch(Exception u){
					Log.getLogger().log(Level.SEVERE, "Unexpected problems with the String " + lo.getLocation());
				}
				Location location = locationDao.findById(place);
				if(location != null){
					beginTransaction();
					location.setLatitude((lo.getLatitude()));
					location.setLongitude(lo.getLongitude());
					picture.setLocation(location);
					commitTransaction();

				}else{
					beginTransaction();
					location = new Location();
					location.setLocation(place);
					location.setLatitude((lo.getLatitude()));
					location.setLongitude(lo.getLongitude());	
					List<Picture> pics = new ArrayList<Picture>();
					pics.add(picture);
					location.setPictures(pics);
					picture.setLocation(location);
					entityManager.persist(location);
					commitTransaction();

				}
			}
		}
	}