Clean spatial picture alloc code
Merge pull request #284 from volvet/clean_spatial_picture_code

Clean spatial picture alloc code
Merge remote-tracking branch 'upstream/master' into travis.osx