Added optional argument to image-size function for ignore errors. Fixes #738