factor out parsing of image block size into a macro

also remove an unused variable