Catch error during image processing

Change-Id: I154f8fb1b4086907045f13fb72cd9973c1ccc748