Error handling for thumbnail creation