Rewrite picture retrieval code.