Properly clone image object when resizing