[?]Pictures and PHP

If I create a log in using session variables (for example (strings)$usernm, $psswd, and (boolean) $loggedin) is it possible to restrict the viewing of a certain picture only to one username?

In other words, if user x wants to see a graphic that I uploaded for him, but I only want user x to be able to see it, is there any way to do this (using the session variable described above)?

Thanks,
Matt