working on copy function for Image<T>