How do i be sure it is IMAC compatible if i buy from third party?
Use a vendor other Mac users have found reliable. For me it is this one:
http://eshop.macsales.com/shop/memory/iMac/2011/DDR3_21.5_27
I have bought all my Mac RAM from them for over a decade and can recommend them highly.
You can use the open slots to get from 4GB to:
<> 8 GB by adding two 2GB modules
<> 12GB by adding two 4G modules
<> 20GB by adding two 8GB module
without replacing the two modules now present. Other increments would require pulling the existing two and replacing them with bigger ones.
Regardless of the total amount, you will get best performance by pairing modules side by side in the slots. The slots will look like this when you remove the RAM door today:
[ 2GB ] [ 2GB ]
[ empty ] [ empty ]
This arrangement after adding two 4GB modules will give best performance:
[ 2GB ] [ 2GB ]
[ 4GB ] [ 4GB ]
This arrangement, although letting the computer work, is NOT considered optimum:
[ 2GB ] [ 4GB ]
[ 2GB ] [ 4GB ]
We don't know where you are located, The firm I linked is a US company but will ship to some, not all, international destinations. If you are not able to order from the place I linked, we'll need a rough idea of where you are to further help get you to a reliable RAM vendor.