Fixes bug in last commit

Tested it several different ways now and as far as I can tell the image editing works fine now.