James Martin/CNET

Google became one of the most powerful companies on Earth because it has developed some of the best algorithms in the world for organizing information. But a gaffe this week shows the shortcomings of technology, particularly when it doesn't work just quite right.

Jacky Alcine, a Web developer who is black, took to Twitter to say Google's Photo app, released in May, labeled a picture of him and a friend as "gorillas.' The label showed up in a feature that automatically categorizes photos, like cars or beaches, so they are more easily searchable.

"My friend's not a gorilla," Alcine tweeted. He didn't immediately respond to a request for comment.

The incident points to the problem tech companies face as computers get smarter and are expected to take on more more tasks a human normally would do. Those areas of computer science -- such as artificial intelligence or machine learning -- are some of the biggest engineering focuses in Silicon Valley. But with that focus comes another task that computers have not traditionally tackled: grappling with the challenge of sensitivity.

Screenshot by CNET

This isn't the first time algorithms have messed up in ways people have found offensive. When Yahoo overhauled its Flickr photo storage app in May, the company added similar features that automatically add tags to photos. The algorithm tagged a photo of a black man as an ape, and concentration camp photos got tags like "jungle gym" and "sport."

After Google learned of the incident with Alcine's photo, the company apologized immediately tried to fix it.

"Lots of work being done, and lots still to be done," Yonatan Zunger, chief architect of social at Google, tweeted. "We're very much on it."

In the mean time, Google apologized.

"We're appalled and genuinely sorry that this happened," a Google spokeswoman said "There is still clearly a lot of work to do with automatic image labeling, and we're looking at how we can prevent these types of mistakes from happening in the future."