Storing images to local database using indexedDB