private void parsePhotoResponse(String jsonResponse, String queryText,
			List<FlickrPhoto> tempList) {

		JSONParser jsonparser = new JSONParser();
		try {
			JSONObject response = (JSONObject) jsonparser.parse(jsonResponse);
			JSONObject responsePhotos = (JSONObject) response.get("photos");
			int page = Integer.parseInt(responsePhotos.get("page").toString());
			int pages = Integer
					.parseInt(responsePhotos.get("pages").toString());
			JSONArray photoList = (JSONArray) responsePhotos.get("photo");
			for (int i = 0; i < photoList.size(); ++i) {
				FlickrPhoto photoTemp = new FlickrPhoto();
				JSONObject photoData = (JSONObject) photoList.get(i);
				photoTemp.setUrl(photoData.get("url_o").toString());
				photoTemp.setLicense(photoData.get("license").toString());
				photoTemp.setMediaStatus(photoData.get("media_status")
						.toString());
				List<String> tagList = new ArrayList<String>();
				String tagString = photoData.get("tags").toString();
				if (!tagString.isEmpty()) {
					tagList = Arrays.asList(tagString.split(" "));
				}
				photoTemp.setTags(tagList);
				photoTemp.setPhotoId(photoData.get("id").toString());
				photoTemp.setTitle(photoData.get("title").toString());
				photoTemp.setOwnerName(photoData.get("ownername").toString());
				photoTemp.setViews(Integer.parseInt(photoData.get("views")
						.toString()));
				System.out.println(photoTemp);
				tempList.add(photoTemp);
			}
			if (page < pages) {
				getNextPage(queryText, ++page, tempList);
			}
		} catch (ClassCastException ce) {
			System.err
					.println("Typecast failed. Response is probably broken. Can be caused by bad request");
		} catch (ParseException e) {
			System.err.println("Error parsing response");
		}
		// if (page < pages) {request next page}
	}