I haven't used the glob() function myself, but a quick check of the PHP manual and I found the following user comment:
MichaelSoft
06-Nov-2003 12:28
Note that, in some configurations, the search is case-sensitive! You'll need to have something like:
<?php
$images = glob("/path/to/images/{.jpg,.JPG}", GLOB_BRACE);
?>
If you need to search in another directory, have you tried putting the directory path that you want to search in as MichaelSoft did?