To disable the photo link on the profile page edit profilePhotos.php.
At about line 412 you will find the following block of code.
$ret .= '<div class="photoBlock" id="photoKeeper">';
$style =
'width:' . $this -> aMediaConfig['size']['photoWidth'] . 'px;'.
'height:' . $this -> aMediaConfig['size']['photoHeight'] . 'px;' .
'background-image:url(' . $sPhotoUrl . ');';
$ret .= '<a href="' . $site['url'] . 'photos_gallery.php?ID=' . $this -> iProfileID . '" id="temThumbLink">';
$ret .= '<img src="' . getTemplateIcon('spacer.gif') . '" style="' . $style . '" class="photo" alt="" id="temThumbID" />';
//$ret .= '<img src="' . getTemplateIcon('spacer.gif') . '" style="' . $style . '" class="photo" alt="" onload="return setThumb();" id="temThumbID" />';
$ret .= '</a>';
$ret .= '</div>';
You need to comment out two lines. The start of the link and the end, so change it to look like this.
$ret .= '<div class="photoBlock" id="photoKeeper">';
$style =
'width:' . $this -> aMediaConfig['size']['photoWidth'] . 'px;'.
'height:' . $this -> aMediaConfig['size']['photoHeight'] . 'px;' .
'background-image:url(' . $sPhotoUrl . ');';
//$ret .= '<a href="' . $site['url'] . 'photos_gallery.php?ID=' . $this -> iProfileID . '" id="temThumbLink">';
$ret .= '<img src="' . getTemplateIcon('spacer.gif') . '" style="' . $style . '" class="photo" alt="" id="temThumbID" />';
//$ret .= '<img src="' . getTemplateIcon('spacer.gif') . '" style="' . $style . '" class="photo" alt="" onload="return setThumb();" id="temThumbID" />';
//$ret .= '</a>';
$ret .= '</div>';
I have marked the lines that need to be commented out in red.