Study the documentation carefully; I remember some gotchas around SQLite's blob handling and possible confusion with strings. (In other words, are you actually passing the correct JPEG stream in?)
Comment on Re: Extracting a blob from DBI to a buffer