Added error handling for loading image from URL