working version for "whole image" (with pdb)