I have to first, see if a webpage is available, then, see if a picture with similar title because the page plus "-small.digital" is available, then display the look. If your page doesn't have an identical image+"-small.digital", I don't want almost anything to display.

Here's a concept of things i need done

<?php
$list_of_pages = all pages
$site_page = 'http://www.samplesite.com/($list_of_pages)'
$site_page_image = 'http://www.samplesite.com/images/($list_of_images).jpg'

if($site_page exists || $site_page_image exists) { echo '<li><a href="' . $site_page .     '"><img src="' . $site_page_image . '" /></li>'; }

Here's some code I have used to try and create a listing of pages removed lower to only page game titles... It returns the 'title=' title however and is not really doing things i require it to.

function call_first() {
function remove_title($input) {
  return preg_replace_callback('#\stitle=["|\'].*?["|\']#',
    create_function(
      '$matches',
      'return "";'
      ),
      $input
    );
  }
add_filter('wp_list_pages','remove_title');

function remove_page_class($wp_list_pages) {
$pattern = '/\<li class="page_item page-item-[^>]*>/';
$replace_with = '<li>';
return preg_replace($pattern, $replace_with, $wp_list_pages);
}
add_filter('wp_list_pages', 'remove_page_class');

function replace_content($content)
{   $stripped_code = array('<li>','</li>','<a>'); 
$content = str_replace($stripped_code, '',$content);
return $content; }
add_filter('wp_list_pages','replace_content'); }

function remove_tags($input) {
  return preg_replace_callback('#\shref=["|\'].*["|\']#',
    create_function(
      '$matches',
      'return "";'
      ),
      $input
    );
  }
add_filter('wp_list_pages','remove_tags');

Any help could be appreciated, Tell me if there's anything I'm able to do in order to help!