Added a check to make sure that the image path is not only not null, but
also not the empty string as this is throwing an exception.