Improve engine.generate_source_image

Firstly, don't require a close attribute on the source file since not
all file-like objects provide this method. This fixes #114 and refs #259

Secondly, ensure we try to re-open (falling back to seek(0)) between
multiple source generators. Fixes #250