Added default image, and some error-checking