Add Keno's work from https://github.com/timholy/Images.jl/pull/156 into this PR