notice these lines:
$query = "Select picture FROM pictures where id='jklassen'";
$result = mysql_query($query);
$query = "Select username FROM profiles where id='jklassen'";
$result = mysql_query($query);
echo "<table border ='0'>\n<tr>\n";
$i=0;
while($picture = mysql_fetch_array($result))
your second $query and $result are overwriting your first $query and $result, so in your while($picture = mysql_fetch_array($result)) statement, you're really saying fetch the array of matching pictures, but you're passing it the query that selects the profile. Make sense?
So change those lines to:
$query_pic = "Select picture FROM pictures where id='jklassen'";
$result_pic = mysql_query($query_pic);
$query_profile = "Select username FROM profiles where id='jklassen'";
$result_profile = mysql_query($query_profile);
echo "<table border ='0'>\n<tr>\n";
$i=0;
while($picture = mysql_fetch_array($result_pic))
hope that helps!