Fix alpha handling for image saving.