Better error handling editprofile.php, closes #175, closes #172

nt