Added try/catch clauses to image display