Bitmap for tiles with specific neighbours

So this is a screenshot of the tiles I’m using. Some of them should come in pairs, or even in fours, but obviously they should be able to have any other neighbor.
image

I’m not sure how to achieve this when I’m making the terrain. I can select if each tile can neighbor stuff in general, but not specific other tiles. Is there a way to do this?