if your trying to get your gallery to run with www on the front at all times you must correct all the urls under global options and edit interation under admin.
Your project thing is still the same answer though. it really does not matter where the link is all i am saying is you must use a full url in the link not a relative one so it can be found when you load your header over another directory. I hope that makes sense to you.