Check if you are running safe mode... If you are not running safemode.. the url to the file should contain the userid gallery/files/u/s/e/r/i/d/filename.jpg
If you are running safemode.. the filename itself contains the userid:
(for userid 325 example
in safemode: gallery/files/325_filename.jpg
in non-safemode: gallery/files/3/2/5/filename.jpg
So it must be another problem..