https://www.getbmwparts.com/v-2016-b...ents-and-rails
I believe it is part #9 (although I’m not 100% sure so please someone correct me if need be). It is essentially the rail that the back two screws of the headlight connect to - if that rail is bent the headlight won’t line up properly.
Doesn’t look like you fender needs replacing based on pics, but like I said depends on what’s underneath. Here’s the fender components page as well if it’s helpful:
https://www.getbmwparts.com/v-2016-b...and-components