widget gallery improvements, optimizing images, read image size in pdfrenderer