Put your gallery into off line mode and do your upgrade - today!
Putting the gallery into offline mode won't help against hackers, but only will inform the legitimate visitors about the fact that you're performing maintenance works. The only positive aspect that offline mode has is the fact that you have a persistent state of the database when performing the database backup: no new content will be added during the process.
The discusion about hiding your site from hackers by removing the link is just silly and shows that you still need to learn how hackers retrieve the information and how they decide about picking a potential victim. Google has got
thousands of links to your site. Security by obscurity is just a silly concept that doesn't work and should not even be discussed because it's a waste of time. You're insulting the hackers by believing that your argument about the removal here in this thread would make a difference. Instead of typing excuses you should have started updating right away.
Back to your original question: the code you posted is just wrong and therefor can not work as expected. There are many flaws inside your custom theme as well, too many to name them and suggest changes (simply because it would take hours). The flaws are on PHP level, on HTML level, on CSS level and on the level of the logic. I strongly suggest to review your stuff closely. I have edited your custom theme accordingly (only what you requested) and have attached the changed theme. As you failed to tell us what the mysterious include file is suppossed to do I have created one and used it just to populate a variable. You will need to review the path.
For details, do
exactly as supporters suggest in the future, without needless discussion.