select resource_id from photo where uid = $myuid and photo_usage=1;
select thumb from profile where uid=$myuid
Fix this in your xchan - change xchan_photo_l xchan_photo_m and xchan_photo_s to your correct channel_id (and change xchan_photo_date to something larger than the it is now so other people will get the changes).