Bug fix for image retrieval. Closes #116