fixed problem with image operation deallocation