fix the bug if certificate has no images
fix bug in certificate update, removing an image