messy image cache using sd card

Very messy code to download images to sd card to save bandwidth when
loading the app.