I dont get why in the first image, S corresponds to Q and R to Q', whereas in second figure S corresponds to Q' and R to Q. Why the polarity of output is switched in enable SR latch. These diagrams are from this page.
The upper circuit is misleading. Ordinarily, applying a high SET input should give a high Q output - to set conventions otherwise is to risk confusing folks, and it has confused you. Note that in the truth table, with SET high and RESET low, Q is low. While this is indeed how the circuit works, from a semantic point of view it makes no sense. A more "normal" description would swap the Q and Q* labels, and at the same time swap 0 and 1 in the output section of the truth table.
It's a pity the page you've linked did not include the truth table for the second circuit. If you find one, you'll see that a SET high produces a Q high, which is the opposite of the truth table for the first circuit.