Determine image size to fix #19