I understand what you are asking.
the problem is that your testing environment contains a sub directory:
thesitename/
whereas the live server does not:
www.thesitename.com
any subdircetory on the end of the domain name will be added to the image paths:
so if your site is at:
thesitename/
the image paths will be:
/thesitename/images/imageName.jpg
the way around this is to use a sub domain, rather that a sub directory, for example
www.thesitename.mytestingserver/
most hosts will offer around 50 sub domains for any one main domain.
by using the sub domain, the paths for the testing server become consistent with the paths on the live server.