Fix handling of already uploaded images.

Use the correct image name including the appropriate suffix everywhere.