Fix custom icons generating errors in recent - thanks Ruth for reporting and testing - fixes #1862

Signed-off-by: emanuele <emanuele45@gmail.com>