Make sure the language mode on your printer is configured accordingly to the language used in the sample code, i.e. ZPL or CPCL. Please use the following SGD command to configure the device.languages to ZPL and retry to print the image from the sample code.
! U1 setvar "device.languages" "zpl"
If your printer was configured to line_print mode, then you would see the text of the ZPL be printed on the label. Please note, the device.languages on most of the mobile printers are default to line_print mode.