improved btimage.fetchimage code