public ImageLoadingParameters startLoadingImages(Gui gui, int windowWidth, Graphics g) throws Exception {
		ImageLoadingParameters ilp = new ImageLoadingParameters();
		ilp.imageUrls = config.getImageUrls();

		int nImages = ilp.imageUrls.size();
		if (nImages == 0)
			return null;

		int loadNImages = config.getCamRows() * config.getCamCols();

		ilp.il = null;
		ilp.imageUrlTypes = config.getImageUrlTypes();
		ilp.indexes = new int[Math.min(nImages, loadNImages)];

		System.out.println("LOADIMGS " + nImages + " " + loadNImages);

		imageSemaphore.acquireUninterruptibly(); // lock around 'currentImageFile'
		String workingOn = null;
		try {
		if (config.getRandomWebcam())
		{
			for(int nr=0; nr<ilp.indexes.length; nr++)
			{
				boolean found;
				do
				{
					found = false;
					ilp.indexes[nr] = random.nextInt(nImages);
					for(int searchIndex=0; searchIndex<nr; searchIndex++)
					{
						if (ilp.indexes[searchIndex] == ilp.indexes[nr])
						{
							found = true;
							break;
						}
					}
				}
				while(found);
			}
		}
		else
		{
			for(int nr=0; nr<ilp.indexes.length; nr++)
			{
				ilp.indexes[nr] = currentImageFile++;
				if (currentImageFile == nImages)
					currentImageFile = 0;
			}
		}
		}
		catch(Exception e) {
			throw e;
		}
		finally {
		imageSemaphore.release();
		}

		int to = config.getWebcamTimeout() * 1000;
		if (to < 1)
			to = config.getSleepTime() * 1000;
		ilp.il = new ImageLoader[ilp.indexes.length];
		try {
		for(int nr=0; nr<ilp.indexes.length; nr++)
		{
				workingOn = ilp.imageUrls.get(ilp.indexes[nr]);
				log.add("Load image(1) " + workingOn);
				drawLoadStatus(gui, windowWidth, g, "Start load img " + workingOn);

			if (ilp.imageUrlTypes.get(ilp.indexes[nr]) == ImageUrlType.HTTP_MJPEG)
					ilp.il[nr] = new MJPEGLoader(workingOn, to);
			else
					ilp.il[nr] = new ImageLoader(workingOn, to);
			}
		}
		catch(Exception e) {
			throw new Exception("" + e + ": " + workingOn);
		}

		return ilp;
	}