I've been back to this topic time and again, but I still can't get a decent ePub from a Kindle purchase. I've tried telling Calibre not to mangle the files, but it doesn't seem to make any difference to the output.
The main problems are:
Extra spaces between lines
Missing spaces between lines
Wrong justification
Wrong indentation
Missing pictures
Unfortunately my Kobo is extraordinarily bad at reading decrypted .mobi files from Amazon, so the conversion to ePub seems necessary. The difficulty is in getting a good copy.
Two particularly difficult books have been
ISBN: 0988263408
ISBN: 0062110543
both from Amazon's Kindle store.
Here is a side-by-side comparison of the original and the best output I can get from Calibre at the moment:

Can anyone advise? I'm not set on using Calibre. Something else would be just fine if it can do a better job. I anticipate this problem is only going to become more frequent as I buy more books from Amazon. I may even have to migrate to Kindle one day. Thanks
NB: The poor formatting in the post is deliberate, and quite accurate in showing some of the problems.