String n = name.toLowerCase();
	private ThumbNailInfo makeThumbNailInfoFromRandom(String name)			throws GalleryException	{		File f = new File(getDirectory(), name + "/" + getThumbsdir());		String subImages[] = f.list(new FilenameFilter()		{			public boolean accept(File dir, String name)			{				String n = name.toLowerCase();				File f1 = new File(dir, name);				if (!(n.endsWith("jpg") || n.endsWith("jpeg")))				{					return false;				}				return !f1.isDirectory();			};		});				if (subImages == null)		{			// no thumbnails created yet						return null;		}				int n = (int) (Math.random() * subImages.length);		File f1 = new File(f, subImages[n]);		InputStream is = null;		try		{			is = new FileInputStream(f1);		}		catch (FileNotFoundException e)		{			// guaranteed that file exists		}		ImageInfo ii = new ImageInfo();		ii.setInput(is);		if (!ii.check())		{			throw new GalleryException("Not a supported image file format.");		}		String thumbWidth = Integer.toString(ii.getWidth());		String thumbHeight = Integer.toString(ii.getHeight());		try		{			is.close();		}		catch (IOException e1)		{			// NOP		}		ThumbNailInfo info = new ThumbNailInfo(getImageBasePath() + name + "/"				+ getThumbsdir() + "/" + subImages[n], thumbWidth, thumbHeight);		return info;	}