img_exists, magic quotes

-uncommented and made modifications to the img_exists function
-replaced deprecated magic quotes function