Errrr.......
There is no " SET status = 'accepted' " in that query.
Have you changed it and if so can you post the new code.
You don't need the AND just a comma so
$query2 = "UPDATE photos SET accepted = 0, status = 'screened' WHERE id = $photo_id";
should work