More is better, although 16 GB should be just fine. Be sure to get a fairly large main SSD and keep it free of any unnecessary files for best performance and available space for Photoshop scratch.
I have two systems, one with 32GB and the other with 16GB, and frankly, I can't tell the difference. And I work with big files from a Nikon D800. Stitching 8 or 10 of those to produce 20 000 pixel panos works equally well on both.
That said, you need an efficient scratch disk setup. The system SSD will work well for this if it has enough capacity - scratch files can be huge. 512GB is minimum. External drives won't work for scratch.
Other than that, my standard advice: The monitor should have priority. A monitor is basically an analog device and the better, the better. This is where it has real and actual impact on the quality of your work. This is where you make judgement calls. The rest of the hardware will just do the same thing slightly slower or slightly faster but the final output is exactly the same.
An iMac screen is in fact a rather mediocre display, clever Apple marketing notwithstanding. You may well see color differences from one side of the screen to the other (a common issue), or general brightness variation. The problem with that, of course, is that you can't calibrate it away, you're stuck with it.