Included the above lines in .bash_profile (my mac is using bash shell) and voila a nagging problem sudo: port: command not found is gone!!!
sudo port -d selfupdate
ran successfully. Now I was able to install FreeImage by running:
sudo port install freeimage