Maybe try this change (replaces the similar block of code from what you posted above):
Code:
if (($ppic = $GLOBALS['vbulletin']->db->query_first(sprintf('SELECT dateline, profilepicrevision FROM %1$scustomprofilepic AS customprofilepic LEFT JOIN %1$suser USING(userid) WHERE customprofilepic.userid = %2$d', TABLE_PREFIX, RollCalls::$vB_User_Id))) != null && $registration['Registration']['profile_picture'] && $registration['Registration']['user_id']) {
$url = sprintf('customprofilepics/profilepic%d_%d.gif', $registration['Registration']['user_id'], $ppic['profilepicrevision']);
} else {
$url = 'images/misc/unknown.gif';
}