Fixed bug in saving the default primary image when none is chosen