Set real size before ensure, or it copies no content.
Clean up unused import.