When using named stages in a multistage build as in the example below, the Jenkins pipeline will fail with the following message right after the build has finished.
There is a workaround to this issue by removing the names and using the build numbers instead. example:
Looking at the related source at #100, it seems the code determains the image name looking at FROM and taking everything until EOL. Which would include 'AS buildname'.
At a glance it also looks like the code will take the first stage for fingerprinting instead of the final stage (which is the resulting image).