Photos: Ravens beat Niners 34-31