I think mysql_fetch_array() will return false if no rows were returned. To aid debugging, I would do something like:
$sql = "SELECT * FROM `accounts` WHERE `id` = 1";
$profilePicSql = mysql_query($sql) or die("mysql_error()<br />query: $sql");
if(mysql_num_rows($profilePicSql) == 0)
{
die("No rows returned. Query: $sql");
}
$profilePicRows = mysql_fetch_array("$profilePicSql");