Forgot to mention... After embedding image, value of (IFD0) ImageWidth and ImageHeight should be updated too (according to new size JPG might have) -maybe not that important, but some software might expect correct values there.
The more I think, more complicated it appears... I need more time...
Bogdan