Allow autodetect to use entire image when no mask is drawn. Also fixes an error that was thrown in this process.