if decrypted_image is not None: # Display image preview image = Image.open(BytesIO(decrypted_image)) image.show()