Cleanup the all image function.