fix #1550 npe image helper.get image size

fix #1550 npe image helper.get image size
This is nitpicky, but should probably check whether the passed context is null as well.