UPDATE: the reason was in the missing `bx_photos_cmts_notes` table in the Photos app. It was look like it has been deleted accidentally.