factor out image shim