Fix issue with size testing in image drawing