fixed bugs in box to make it compile, segfaults still in image