Added check for content type and size