better image handling for tabs