this is how i had the script

index.php in folder called pics chmod the folder to 777

the folder was 1 page before the wap scripts so u may hav to adjust some links depending where ur site scripts are...

then add following links to main page for gallery

wml version link:
echo "<a href=\"../pics/index.php?action=gallery&amp;sid=$sid&amp;script=wml\">Gallery</a><br/>";

xhtml version link:
echo "<a href=\"../pics/index.php?action=gallery&amp;sid=$sid&amp;script=xhtml\">Gallery</a><br/>";