Fixes some bug with image provider

Closes #4
Fixes #6