handle multiple JS messages more robustly in getPixmap

Addresses issue #134 (and adobe-photoshop/generator-assets#182)