public function getValidFiles($index = null)
	{
		// prepare the selection
		if (is_numeric($index))
		{
			$selection = $this->container;
		}
		else
		{
			$selection = (func_num_args() and ! is_null($index)) ? $this[$index] : $this->container;
		}

		// storage for the results
		$results = array();

		if ($selection)
		{
			// make sure selection is an array
			is_array($selection) or $selection = array($selection);

			// loop through all files
			foreach ($selection as $file)
			{
				// store only files that are valid
				$file->isValid() and $results[] = $file;
			}
		}

		// return the results
		if (is_numeric($index))
		{
			// a specific valid file was requested
			return isset($results[$index]) ? array($results[$index]) : array();
		}
		else
		{
			return $results;
		}
	}