Hi,
Going to ~/Library/Messages and deleting the three Database items will lose the history to all the Chats that the iMessages side has kept - and - delete reference to ~/Library/Containers/com.apple.iChat/Data/Library/Messages/Archive where all Saved Chats are stored be they iMessages, AIM or Jabber chats.
Pictures in chats come through different servers and become Attachments to chats/Conversations.
Some apps that have firewall abilities like Little Snitch block app and processes from app that don't have the main App's name in their title.
This IMRemoteURLConnectionAgent is the one that logs the iMessages side into iMessages

There is another process that opens and closes around pictures or files (as that is what they actually are) are sent.
This has IMTransferAgent in it's name.
The Mac firewall will allow process linked to an app.
Another issue can be the servers
Names like init-p01md.apple.com
can confuse some DNS servers.
Sometimes adding a public DNS server to your list on the Mac and in the Router can help.
One search Free and Public DNS Server List (August 2017)

9:19 pm Wednesday; August 30, 2017
iMac 2.5Ghz i5 2011 (Sierra)
G4/1GhzDual MDD (Leopard 10.5.8)
MacBookPro 2Gb (Snow Leopard 10.6.8)
Mac OS X (10.6.8),
iPhone 6 iOS 10.x and an iPad (2)