I'm not familiar with tNG_fileExists, however I think this would work:
if (tNG_fileExists("uploads/images/pages/", $Rsi_pages->getColumnVal("page_photo1")))
But I think it would also work with:
if (file_exists("uploads/images/pages/", $Rsi_pages->getColumnVal("page_photo1")))