so what you want is for a manually uploaded photo from a user to get priority over a gravatar image?
have you tried surfalot’s solution:
<?php
$the_photo = '';
if (function_exists('userphoto__get_userphoto') && defined('USERPHOTO_THUMBNAIL_SIZE') && !empty($comment->user_id))
$the_photo = userphoto__get_userphoto($comment->user_id, USERPHOTO_THUMBNAIL_SIZE, /* before */ '', /* after */ '', array('class' => 'avatar'), /* def src */ '');
if (!empty($the_photo)) echo $the_photo;
else echo get_avatar( $comment, 32 );
?>
you’ll need to edit functions.php at line 134 in p2 1.1.5.
this is what you need to replace with above:
<?php echo get_avatar( $comment, 32 ); ?>