As i see it if you create an image the copyright is obviously yours, however if you then use that image incorporated into a website layout that your selling to someone, your giving them the right to use it and publish it online.
You would still retain the copyright to the image, but in fairness a week or a year or two later if they no longer require your services you can hardly ask them to remove the image, you sold it to them as part of the layout, you havent loaned it to them.
If however you were not paid or the contract broken in some way you might have some recourse.
Some companies may ask you to give them sole rights to the image so you could not use it again, but then you would charge accordingly, probably more so in the case of Logo`s.
Regarding formats, a working file is just that, it can be altered easily, a flattened image is just the end product, unless the working file is altered it is the same image.
Anyway thats just my thoughts on it, someone might know the law better and put you on the right track.