Handle image load errors properly.