Find a cheap external SSD with USB-C connector with a speed of least 1000 MB/s (but doesn't need much higher speed).
Find external SSD's using Tweakers Pricewatch (Dutch price comparison page) (max 100 euro, min 256GB, in 1000 MB/s)
Maybe use a right angle adaptor for placing the SSD behind the iMac (so it doesn't stick out as much)
Facts
iMac 2017 has Thunderbolt 3 ports using a USB-C connector. This port also supports USB 3.1 Gen 2 (10 Gbps).
External USB-C SSD: cheap but the iMac not supporting USB 3.2 means you'll be limited to around 1,000 MB/s.
External Thunderbolt 3 SSD: expensive and limit choice, but they can reach up to 4 times the speed (4,000 MB/s ?)
No Intel iMac models supports dual-lane USB 3.2 Gen 2x2, so when looking for an high speed SSD (> 1000 MB/s) watch that the SSD will reach this speed without mentioning (G2x2)
Options
Transcend ESD310 256GB Zwart (256 GB, €32,31) USB 3.2 (Gen2, 10Gb/s) type-C Read sequential: 1050 MB/s Write sequential: 950 MB/s (very compact so easy to tape to the back of the iMac)
Transcend ESD300 512GB Blauw (512 GB, €47,26) USB 3.2 (Gen2, 10 Gb/s) type-C Read sequential: 1050 MB/s Write sequential: 950 MB/s (very compact so easy to tape to the back of the iMac)