Added figure handling for when the image dimensions change. Added bounding boxes drawing.