Check the size of a file or image