gallery and image rendering improved