Just replace "the result" with "it" and it should work.
The user response of an answer dialog is stored in the variable "it".
Btw, pressing "cancel" in an "answer file" dialog does return nothing to the variable "it"
So you could change your script like this
answer file "Bitte Bild auswählen" with type "Images|jpg|jpeg|png"
if it is not empty then put it into tMyImagePath
...
end if