Store and retrieve images in a sql database