A possible theory. James brothers switched
So what if Troy was the killer and is the one who visited Maggie at the dock. Troy knew Brandon would be killed. So he told Brandon to stay away. So he went on to the dock and gave Maggie the necklace that Brandon made for her. But before he can say anything, as he predicted, he's shot and killed by police.
Later, Maggie finds Brandon, injured from a fight possibly. We know that the killings and the beating took place on the same night. Who's to say maybe someone hadn't stabbed Brandon, which would have really off Troy. So Brandon is injured. But he looks guilty still. So Maggie and Miguel hide him.
Later, they'd tell Emma that it was Troy that she visited as a child. But that's just a cover up. Because their story would be that it was Brandon and NOT Troy who the police killed. And Brandon would live Troy's live since Troy gave his own life to Brandon. This would explain why Brandon's face is scratched off in the picture. All evidence of Brandon was to be erased. But through the years, Brandon would have his face fixed. So by 2016/17 he'd had a new look.