Rewoking image decoder thread logic