Move missing countImagesInDir function to getpage.php