How long does the query take? Are there any errors in the gateway logs? What errors are there in the browser logs? How are you providing the image data to the image component? What format are you storing the image in the database as?
Have you tried using: