If oldSize is still incorrect, how about ignoring it completely in favor of the saved sizeX/sizeY?
Updated based on review.