auto buffer size for jpeg images