added image retrieval functionality