Fixed issue #101, which affected image layers and masks
Merge remote-tracking branch 'caleb531/master'