Not sure how you are measuring at the gateway and at the computer? Are you wireless or wired? You can run an Ethernet cable for quite long distances with little signal loss. If the computer is not moving, run a wire, under the rug, over the door, out a window from the basement, whatever, just run a cable. Those 2012 iMac models have Gigabit Ethernet ports.
If you are using WiFi the 2012 iMacs have the older 802.11 a/b/g/n (ie WiFi 4) which does indeed have EVERYTHING to do with your wireless internet speed. Theoretical max of that standard is 480 Mbit/s, but real world performance is probably going to be half that if you are lucky, or nearly 200mbps which is what you are reporting.