Fix bug if no image exits