In short
In fact the two notations are semantically almost equivalent. The only thing that is missing, is that in the second diagram you also express the multiplicity that you would have on the association end, with:
image: Image [0..1]
Additional explanations
Section 9.5.3 of the UML specifications explain that:
A Property may represent an attribute of a Classifier, a memberEnd of an Association, or in some cases both simultaneously.
The difference between the two is about ownership (by the class vs. by the association) being understood that in a binary association like yours, the property could be owned by both at the same time.
Preferring the member end (first diagram) over the attribute (second diagram) is only a convention that does not need to be enforced:
A useful convention for general modeling scenarios is that a Property whose type is a kind of Class is an Association end, while a property whose type is a kind of DataType is not. This convention is not enforced by UML.
Indeed, a «dataType» is like a class, but with a value semantic: instances are only distinguished by their values (typical behavior of build-in types in many languages).
This is why you almost always see primitive UML types (String, Integer, Real, ...) and built-in language types (assuming a language specific UML profile is used) as attributes, and all the classes as associated elements. But you're not required to do so, and your example is a perfect illustration, why it makes sense to sometimes derogate from the convention.