added image destruction mechanism