Added image size setting, buffer size checking