Bug fix for image retrieval. Closes #116

closes #116