Add checking whether input image is empty