Workaround for bam file with whitespace in the name.

Cleaned up error messages a bit, applied a (hopefully) temporary workaround for bam files with
spaces in their names (spaces will be changed to underscores in the saved image.