Fix: Crash when the image is empty.

Signed-off-by: unknown <teyan@TEYAN-THINK.fareast.corp.microsoft.com>