I've been making epubs from InDesign CS5 from a single file instead of a book and exporting a file without a cover. I then convert it in Calibre from epub to epub and add the cover during that process. No coding no hassles.
You can achieve the same thing in Sigil as well. You can insert a cover image and nominate it as a cover file.