Welcome to the Ranch
Always use the
code button. Since you are new, I have used the code button on the code for you, and doesn't it look better
I can see a major problem, I am afraid. You appear only to have one class.
You should separate the retrieval from the database and the display into separate classes. Please write a class which loads the image from the database, and see how that works. If you can load and save the image, you have made a start.