implemented image unloading