The problem is in this following bit of code at the bottom of teamadmin.php - I don't know much PHP or I would try to fix it. It is automattically saving the path to the images in the DB with the gif extension regardless of the filetype. The upload function in function_team is saving them properly - All that needs done is a way to add the correct extension in this code here so it referrences it correctly in the DB.
PHP Code:
if ($_POST['do'] == removeavatar) {
$teamid = $_POST['teamid'];
// Delete Avatar image from server
$teamoldava = "team".$teamid."_avatar.gif";
@unlink("images/teamavatars/$teamoldava");
$team_ava = "team_noavatar.gif";
$DB_site->query("
UPDATE " . TABLE_PREFIX . "teams
SET avatarurl='images/teamavatars/$team_ava', avatar='0'
WHERE teamid ='$teamid'
");
header("Location: teamadmin.php?&teamid=$teamid");
}
// upload avatar
If($_POST['do'] == doupload) {
$teamid = $_POST['teamid'];
doupload();
$team_ava = "team".$teamid."_avatar.gif";
$DB_site->query("
UPDATE " . TABLE_PREFIX . "teams
SET avatarurl='images/teamavatars/$team_ava'
WHERE teamid ='$teamid'
");
header("Location: teamadmin.php?&teamid=$teamid");
}