Fix infinite recursion when an empty image is not supplied