Why couldn't they take pictures of a closer black hole? The latest photos of the M87 black hole capture light from around a black hole at the center of the Messier 87 galaxy, which is 16.4 Mpc ($5.06 \times 10^{20}$km) from our milky way.
Why couldn't / didn't the scientists involved take photos of black holes less distant, for example  those at the center of our Milky Way or Andromeda (0.77 Mpc) or Triangulum Galaxy? Wouldn't these black holes appear larger and the photos have greater detail / resolution and be easier to capture?
My intuition would be that maybe black holes at the center of closer galaxies aren't as large, or maybe they have more matter in the way / aren't directly aligned with our view from earth making it harder to capture them, but I don't know for sure.
 A: Since this isn't covered by Rob Jeffries' answer, let me add that Sagittarius A* (the black hole in the centre of Milky Way) was considered, but as explained by Heino Falcke at press conference revealing the photo (quoted after Deccan Herald)

Sagittarius A Star is 1000 times faster and smaller. Its like a toddler who is moving constantly. In comparison, M87 is much slower, like a big bear,

On the other hand both M87 and Sgr A* were "photographed" (i.e. data required was captured) it was just "easier" task to process data for M87 so we may expect picture of Sgr A* as the next one in some time.
As stated on EHT webpage

We study supermassive black holes Sgr A* and M87 because their apparent sizes are much larger than those of stellar-mass black holes when viewed from the Earth, so they are easier to study.

A: The "size" (Schwarzschild radius) of a black hole is directly proportional to its mass. The figure of merit that has to be considered, in order to resolve any spatial detail, is the angular diameter of the black hole as viewed from Earth. This will scale as $M/d$, where $d$ is the distance.
My understanding is that the black hole in the centre of M87 and Sgr A* at the centre of our Galaxy are the two black holes with the largest value of $M/d$.
Sgr A* : $M/d \sim 4\times 10^{6}/8 = 5\times 10^{5}\ M_{\odot}$/kpc;
M87 : $\ \ $ $M/d \sim 6\times 10^{9}/16\times 10^3 = 3.8\times 10^5\ M_{\odot}$/kpc.
Your suggested alternatives.
Andromeda : $M/d \sim 2\times 10^8/8\times 10^2 = 2.5\times 10^5\ M_{\odot}$/kpc;
Triangulum: doesn't have a known central supermassive black hole?
So Andromeda is not a crazy target. It's angular size is only 2/3 that of M87. However, another issue is how many of the 8 telescopes in the network can view Andromeda at any one time? It's impossible for the South Pole (as was M87), but also not visible for very long from Chile, so there is a reduced baseline coverage.
A further crucial argument is to consider the timescale of variability in the object. In order to co-add images you need be sure the image is stable on long enough timescales. But the timescale of variability for accretion-illumination in a black hole is proportional to its mass (see Why was M87 targeted for the Event Horizon Telescope instead of Sagittarius A*?) and this timescale is only about 2 minutes for Sgr A* and and hour os so for Andromeda. This makes less massive black holes harder to image with this interferometric technique.
