Fix bug where savePixmap settings.quality was incorrectly compared to a string

Also ensures that arguments to savePixmap are coerced to the correct types.