I would upgrade to the one with the dedicated graphics card. 8 GB of ram should be sufficient, but if I remember the 21.5 memory is not upgradable. If that is the case, go for the 16 GB (for the future).
AC19(9001), 27" iMac i7, 12 gb ram, ATI Radeon HD 4850 512mb, OS 10.12.6