You could store the image location and user ID in the session and use that to populate the locked page even after the user has logged out. Then apply the login server behavior on this page using the session userID and entered password.
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.