For what it's worth, Guilford didn't buy the B&M until 1983, and they didn't acquire the ex-Conrail GP40s (including #340 in your first photo) until 1985. Those units didn't get repainted into Guilford colors until a year or two later, and they didn't receive ditch lights until the late 1990s... so that shot of 340 is probably from the late '90s.
Pan Am Railways — Boston & Maine/Maine Central — Delaware & Hudson
Central Maine & Quebec/Montreal, Maine & Atlantic/Bangor & Aroostook
Providence & Worcester — New England — GE Locomotives