Added image load error checking.