Hi Frnds

I m Using Photo Album ..... when i connect to Server through Php FTP script connection .... in image sorting m getting 1 problem.

Example:
1.jpg (Main Images)
2.jpg
3.jpg
th_1.jpg (Thumbnail Main Images)
th_2.jpg
th_3.jpg

Prob: my script also Sorting "Thumbnail Pics" but i want to sort only "Main Image"

How can i set Files Sorting Filter .... plzz help/give me php Filter Function who filter and Remove "th_1.jpg, th_2.jpg, th_3.jpg" from sorting and show only "1.jpg, 2.jpg, 3.jpg"


Code:
$dir = "h t t p:/ /w w w.domain.c o m/anyalbum";
$filearray = array();
if ($fil = opendir($dir))
{
while (($file = readdir($fil)) !== false)
   {
//if ($file != "." && $file != "..")
if (strpos($file, '.jpg',1)||strpos($file, '.gif',1) )
      {
$filearray[] = $file;
      }
   }