Your answer is technically correct, although a weird way of doing it. It appears the OP's image is floated to the left (or maybe the right, we don't know). That is why the image would display "outside the division" since floated elements do not take up space. Your solution was to also float the parent division, which also removes it from the flow and causes it to expand to the size of it's inner floated element (I don't know if that's supposed to happen, but apparently it does). If that wasn't the issue, then this question really ought to be deleted as the problem cannot be clearly identified.
I have no idea why they're obsessing over
display: block. Yes, it's true that divisions default to that and yes, it's true that line doesn't need to be there and serves no purpose. I'll also note that any element that's floated automatically becomes
display: block implicitly no matter what the display property is actually set as for that element. However, it does no harm being there and the comments about it are just useless noise.
The main reason I see a downvote occurring is that it's an odd and, might I say, inappropriate way of fixing the problem. Floating more content to account for floated content isn't a great solution, as it opens more potential for messing up the rest of the layout for the page. All in all, just because the solution worked in this specific case for the OP doesn't mean it's the best solution. The only thing the check-mark means is it helped the OP. There are better solutions out there, and the community is voting in that regard so that future visitors won't go through the headaches of "ok, now I'm having this problem."