Fixed bug causing sample export to fail if screen orientation changed
during export.
Fixed bug which resulted in empty image files being created when the
user sketched or took photos and cancelled the operation.