Improve speed for save residual images