GALLERY: 49ers score 17 unanswered to surge past Panthers